• AUDIT
  • DEBUG
  • INSPECT
  • REVIEW

How to query Rego policy data with your AI

Connect Aserto to your agent to pull live policy data and run custom queries. Your AI handles the Rego logic while you get the answers.

Ask AI about this page

Short answer

Can my AI run Rego queries?

Yes. Your AI uses Aserto to execute custom Rego queries and traverse policy decision trees. You'll get direct access to policy data structures and authorization results.

Policy insights.

Where your data lands.

The AI uses Aserto tools to turn raw policy logic into actionable data.

AUDIT

Verify policy logic

The AI runs queries against your Rego policies. You get a clear view of how permissions are structured.

DEBUG

Trace decisions

Your agent follows the decision tree to see why a specific access request was allowed or denied.

INSPECT

View data structures

The AI pulls the underlying policy data. This lets you see the exact attributes used in your authorization logic.

REVIEW

Human oversight

The AI presents the query results and decision paths. You decide if the policy behavior matches your intent.

The workflow

What your AI does when the query arrives.

Your agent acts as the bridge between your natural language questions and the Aserto policy engine.

  1. Interpret intent

    Your agent translates your question about permissions or users into a specific Rego query.

    authz_query
  2. Execute query

    The AI sends the request to Aserto to pull the relevant policy data.

    authz_query
  3. Trace logic

    If you ask why a decision happened, the AI walks through the policy branches.

    authz_decisiontree
  4. Report findings

    The agent summarizes the policy data or the decision path in plain English.

    authz_decisiontree

Try it

Copy these to start.

Use these prompts to begin interacting with your policy data.

Starting points

Swap the bracketed terms for your actual policy names or user attributes.

Aserto Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_XOpJU2PJe7LAxPuGtGU6XTuW4mAiWsbg1RviddXw/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat — Aserto capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "aserto-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_XOpJU2PJe7LAxPuGtGU6XTuW4mAiWsbg1RviddXw/mcp"
    }
  }
}
Copy into chat04
  • Run a Rego query to find all users with the 'admin' role in my policy.

  • Show me the decision tree for the 'billing_access' policy to see why this request failed.

  • Query the policy data to list all resources owned by user 'dev_user_01'.

  • Explain the logic behind the 'api_gateway_authz' policy using the decision tree.

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect Aserto once, then ask.

Link your Aserto account in one click. Your credentials stay encrypted, and you can start querying immediately.

Connect Aserto to your AI

FAQ

How the Aserto connector behaves

  • 01

    Can the AI change my Rego policies?

    No. The AI can only read policy data and execute queries. It cannot write, edit, or delete your Rego files.

  • 02

    Does the AI have permission to delete users?

    No. There are no tools provided to modify user identities or delete data.

  • 03

    How does the AI know which policy to query?

    You specify the policy name in your prompt, or the AI infers it from the context of your question.

  • 04

    Can I use this with Claude?

    Yes, any MCP-compatible client like Claude, Cursor, or Windsurf works with this connector.

  • 05

    What happens if a query returns no results?

    The AI will report that no data matched your query criteria based on the current policy state.

  • More questions about Aserto? See everything the Aserto Connector can do

Connect Aserto to Claude, Cursor, ChatGPT & more