Back to all guides
Agent Gateway

IBAC Engine: Intent-Based Access Control in the Agent Gateway

How intent-based access control (IBAC) works in the IndyKite Agent Gateway: the intent of a prompt, the coarse authorization mappings an A2A agent or an MCP server declares on its skills, tools, resources and prompts, how the IBAC engine matches one against the other in discovery and in usage, the AuthZEN requests it derives, its reason codes and its audit records.

What is IBAC?

The Agent Gateway decides on every call who is calling: the user, the chain of agents acting for them, and whether that chain may reach the protected agent. Intent-Based Access Control (IBAC) adds what for. It reads the intent of the prompt, compares it with what the skill or tool it is about declares it does, and derives from the match the fine-grained AuthZEN checks to run. A prompt that asks for something the capability was never declared for is refused before any data moves; one that fits is checked against the knowledge graph for exactly the subject, action and resource it names.

IBAC compares two things. On the left, the intent: the Intent Agent turned the prompt What is the price of the quote stock_quote into one evaluation, subject Person the caller, action GET_PRICE, resource Quote stock_quote. On the right, the declaration: the skill quote-lookup on the agent card of the Trading Desk Agent declares in its x-coaz-mappings the subject Person $token.sub, the actions CAN_RETRIEVE and GET_PRICE, and the resource Quote stock_quote. The IBAC engine checks that the two agree on subject type, resource type and action. It never reads the prompt and it makes no access decision: the platform does.

Two sides of one question: the intent says what someone wants, the declaration on the skill says what the skill can do, and IBAC checks that the two agree.

Part Who provides it Shape
The intent: what the prompt asks, as AuthZEN evaluationsThe Intent Agent, asked by the gateway with ibac.enabled{prompt, evaluations: [{subject, action, resource, context}]}
The mapping: what a skill or tool does, as the subjects, resources and actions it touchesThe author of the A2A agent card or of the MCP server, under x-coaz-mappings[{subject: [{type, id}], resource: [{type, id}], action: [{name}], context}]
The decision: whether this user may do this to this resourceAuthZEN and the project's KBAC policiesPOST /access/v1/evaluation per derived request

The IBAC engine is the part of the gateway that joins the first two: it matches an intent against the mappings of a capability, says which skills could serve it (discovery), confirms one skill and produces the AuthZEN requests to run (usage), and writes one audit record per evaluation. It never decides on its own; every grant stays with AuthZEN.

What the gateway does with ibac.enabled.

  • In front of an A2A agent, it asks the Intent Agent about every message/send and message/stream request whose message has text, and forwards such a request only when an intent is found (below). A message without text, and every other A2A method, is not asked about and goes through on the admission check alone. With a Token Service, the intent is also written into the delegation token the agent receives, in act.intent of the hop, so the next hop carries it.
  • In front of an MCP server, for an invocation whose delegation token carries an intent, it checks the mappings of the capability the call names, as the server lists them. A mapping that cannot be read refuses the call; a capability without a mapping goes on or is refused, as ibac.capabilities.unmapped says; a capability with a valid mapping is checked against the intent, and when the intent matches, the platform is asked about the evaluations resolved from the matched mappings: the call goes on only when both pass. Each check writes an IBAC_USAGE record (Agent Gateway guide).

Which tools, resources, prompts and skills a caller may use is decided by the gateway's capability checks, a KBAC search over CAN_USE per capability kind; the mappings describe what a capability does, not whether this caller may use it. From Declaring what a skill or tool does onward, this guide describes the engine's contract: what to declare, how an intent is matched against the mappings in discovery and usage, and what each evaluation writes to the audit trail. The gateway's check reads and validates the mappings; it does not match the intent against them or derive AuthZEN requests from them.

What does the gateway run with ibac.enabled?

IBAC runs in four places. The table is the overview; the paragraphs below give the rules of each.

Where What is compared Runs when Outcome Audit records
A2A message The intent of the prompt, with the mappings of the skills the caller may use on the agent. The Intent Agent is asked for every message with text. The comparison with the skills needs a Token Service. No intent: the gateway answers in place of the agent. Nothing fits the skills: 403. Otherwise the message goes on, and the token carries the evaluations that fit. INTENT, IBAC_DISCOVERY
A2A extended agent card The current intent, with the mappings of the skills on the card. The delegation token of the request carries an intent. The card lists only the skills that fit. Nothing is refused. DISCOVERY, IBAC_DISCOVERY
MCP list (tools/list, resources/list, prompts/list) The current intent, with the mappings of the entries of the list. The delegation token of the request carries an intent. The list keeps only the entries that fit. Nothing is refused; a list can come back empty. DISCOVERY, IBAC_DISCOVERY
MCP call (tools/call, resources/read, prompts/get) The current intent, with the mapping of the capability the call names, its ids read from the call and the token; then the resolved evaluations, at the platform. The delegation token of the request carries an intent. The intent does not match, or the platform denies: 403. Otherwise the call goes on. IBAC_USAGE, RESOLVED_EVALUATIONS

A token carries an intent when an earlier hop wrote one into it: a gateway in front of an A2A agent, with a Token Service, after the Intent Agent answered. Without an intent in the token, the last three rows do not run.

In front of an A2A agent, the gateway sends the text parts of each message/send or message/stream message that has text, joined one per line, to the Intent Agent with the user resolved by ContX IQ whoami as subject_type and subject_id, after its own admission check and before forwarding. A message without text, and every other method, is not sent to the Intent Agent. A message with an intent goes on. A message the Intent Agent failed is answered in place of the agent, with status 200, an agent message whose text is the error and the obligation and whose metadata.intent_error holds {prompt, error, reason, obligation}. An Intent Agent that cannot be asked refuses the message with 502, one that does not answer in time with 504. In front of an MCP server, ibac.enabled needs nothing more and the Intent Agent is not called.

In front of an A2A agent, the gateway also runs discovery over the extended agent card, when the delegation token of the request carries an intent: the card lists only the skills that fit the current intent, of the permitted skills with capability checks on and of every skill of the agent with them off. The current intent is the newest intent in the act chain of the token. Before the engine is asked, a skill without a mapping is settled by ibac.capabilities.unmapped, kept under allow and dropped under deny, and a skill whose mapping cannot be read, or whose id the card lists twice, is dropped. Only the skills with a mapping go to the engine, at most 64 at a time. Without an intent in the token, the card is filtered to the permitted set only, or with capability checks off lists every skill. With a Token Service, a message is compared with the mappings too, before it is forwarded: each evaluation of its intent must be covered by a skill the caller may use, by subject type, resource type and action. The evaluations no skill covers are left out of the delegation token the agent receives, and an intent of which nothing is covered refuses the message with 403. A skill without a mapping covers everything under ibac.capabilities.unmapped: allow and nothing under deny; since a message does not name the skill it uses, one permitted skill without a mapping lets the whole intent through under allow. Without a Token Service, messages are not compared with the mappings.

In front of an MCP server, the gateway runs usage on every call whose delegation token carries an intent and whose capability has a valid mapping, in two steps:

  1. Against the intent. The call goes on only when at least one evaluation of the current intent matches a mapping of the tool, resource or prompt by subject type, resource type and action. The references of the mapping are resolved from the call: $request is the params of the request, so $request.arguments.docId reads an argument of a tools/call and $request.uri the URI of a resources/read; $token is the claims of the delegation token. Nothing is read from the intent. A call the intent does not match, or that lacks a value a mapping reads, is refused with 403.
  2. At the platform. For every matched mapping whose subject and resource both name an id, one AuthZEN evaluation is resolved: the resource with its id and the action of the matched evaluation of the intent. The gateway sends them in one POST /access/v1/evaluations, with the subject whoami resolved, and the call goes on only when the platform allows every one. The policies that decide them are your own KBAC policies, for example one that lets a Person READ a Document.

The platform is not asked when no evaluation is resolved. That is right for a mapping that names no resource id, such as a search. It also happens when the id is there and the action is not: a mapping that lists no action, matched by an evaluation of the intent without an action. Such a call goes on unchecked, so a mapping that names ids should list its actions and name the id of its subject.

The lists are filtered by the intent as well. Of a tools/list, resources/list or prompts/list answer, an entry stays when one of its mappings matches at least one evaluation of the current intent, by subject type, resource type and action: this is discovery, run over the entries of the list. With capability checks on, only the permitted entries are compared; with them off, every entry. An entry without a mapping follows ibac.capabilities.unmapped, and one whose mapping cannot be read is removed. Nothing is refused: a list can come back empty. The refusal messages and the audit records are in the Agent Gateway guide.

Key Default Meaning
ibac.enabledfalseSwitches IBAC on. Off, the Intent Agent is never called and the intent_agent section is not read. On, in front of an A2A agent, intent_agent.base_url is required.
intent_agent.base_urlWhere the Intent Agent serves its agent card; an absolute http or https URL.
intent_agent.audienceintent_agentAudience of the client credentials token the gateway gets for the Intent Agent; must match its EXPECTED_TOKEN_AUDIENCE.
intent_agent.timeout45sHow long one prompt may take, the token grant included.
audit.include_promptfalseAdds the prompt, and the reason of a failed task, to the INTENT audit records.

Each call is audited with action INTENT and decision INTENT_FOUND, INTENT_FAILED or ERROR. The exact answers, refusals, startup errors and reason strings are in the Agent Gateway guide; the Intent Agent's request and the shapes of an intent are in the Intent Agent guide.

Declaring what a skill or tool does: x-coaz-mappings

A capability is what sits behind a gateway, described by a name and a list of skills: the skills of an A2A agent card, or the tools, resources and prompts an MCP server lists. Each skill may carry coarse authorization mappings under the key x-coaz-mappings: the subject types, resource types and actions it works with, in the vocabulary of your data schema and KBAC policies. The key lives:

  • in an A2A skill, as a key of the skill entry itself, next to id and name;
  • in an MCP tool, resource or prompt, under the entry's _meta. When an entry carries the key both in _meta and at its top level, _meta wins. The IndyKite MCP server fills it for each Knowledge Query tool from the query's description, see the MCP Server guide.
A mapping under x-coaz-mappings on a skill has three fields. Subject: the types of caller the skill serves, here type Person with the id $token.sub, whoever is in the token. Resource: the types of thing the skill works on, here type Quote with the id stock_quote. Action: the actions it may perform there, here CAN_RETRIEVE and GET_PRICE, named exactly as the KBAC policies name them; no action listed means any. An id can take three forms: a literal such as stock_quote, when the skill is bound to one resource; a reference such as $request.arguments.tier or $token.sub, read from the call or the token; or no id at all, when the skill works on whichever resource the caller may reach, which is a search.

A mapping at a glance: three fields, and three forms an id can take. The rules for each follow below.

{
  "name": "read_document",
  "inputSchema": { "type": "object", "properties": { "docId": { "type": "string" } } },
  "_meta": {
    "x-coaz-mappings": [
      {
        "subject": [ { "type": "Person", "id": "$token.sub" } ],
        "resource": [ { "type": "Document", "id": "$request.arguments.docId" } ],
        "action": [ { "name": "read" } ]
      }
    ]
  }
}
{
  "id": "read-document",
  "name": "Read a document",
  "x-coaz-mappings": [
    {
      "subject": [ { "type": "Person", "id": "$token.sub" } ],
      "resource": [ { "type": "Document", "id": "$request.arguments.docId" } ],
      "action": [ { "name": "read" } ]
    }
  ]
}
Field Rules
subjectRequired, 1 to 64 entities. Each has a type, a node type of the graph, and an optional id: a literal external_id or a reference.
resourceRequired, 1 to 64 entities, same shape.
action0 to 64 entries of {"name": "…"}, each name required. An empty or absent list allows every action.
contextOptional object of at most 64 keys. Carried with the mapping; the engine does not match on it.
  • A type is 2 to 64 characters, a letter or underscore followed by letters, digits or underscores, the same rule as a node label in Cypher.
  • A skill has at most 64 mappings; a capability has at most 64 skills; every skill needs an id and a name.
  • An entry without the key, with "x-coaz-mappings": null or with an empty list declares nothing, which is not an error. A capability none of whose skills declares a mapping evaluates to missing_coaz_mapping (reason codes).
  • A mapping that cannot be read is an error for the whole entry: invalid field x-coaz-mappings: … when the value is not a list of objects, invalid field x-coaz-mappings[<n>]: mapping is null, invalid field x-coaz-mappings[<n>]: invalid field subject[0].type: "x" does not meet rule min=2 and the like for a field that breaks a rule, invalid field _meta: … when _meta is not an object, invalid capability entry: … when the entry itself is not a JSON object.

References in an id

An id that starts with $ is a reference, resolved when a usage evaluation runs, against the parameters handed to that evaluation. A dot walks into a nested object: $token.sub reads sub inside token, $request.arguments.docId reads the tool argument docId. The value must be a non-empty string; a missing key, a nested path through something that is not an object, a non-string or an empty string leaves the reference without a value, and a mapping with a reference that has no value does not match at all, whichever of its entities carries it. So a call without a value the mapping reads never passes as a match. A dot always separates two field names, so a field whose own name contains a dot cannot be read. An id without $ is used as it is. Types are never references.

The intent the engine reads

The intent is the Intent Agent's answer, {prompt, evaluations}, with at most 64 evaluations. Each evaluation needs a subject and a resource, each with a type and an optional id; an optional action with a name; and an optional context whose parameters and qualifiers are objects of at most 64 keys and whose filters is the CEL expression the Intent Agent writes, a string. context.input_params appears only in the AuthZEN requests the engine generates; the Intent Agent does not write it. The filters are carried but never matched on, so they change no decision; apply them yourself to what a search returns, as the Intent Agent guide describes. An intent that breaks one of these rules evaluates to invalid_intent, with the validation message as the reason. The shapes an intent can take, a search without a resource id, a second subject behind a gate, filters and qualifiers, are described in the Intent Agent guide.

Discovery: which skills could serve the intent?

Discovery takes one evaluation of the intent, here Person GET_PRICE Quote, and asks every skill three yes or no questions: is the subject type the same, is the resource type the same, and is the action listed. The skill quote-lookup of the Trading Desk answers yes three times and matches. The skill core-banking of the Trading Desk has the subject type Person but works on Customer, not Quote, so it does not match. The skill my-invoices of Billing works on Invoice, so it does not match either. Ids are ignored at this stage. One matching skill is enough: the capability can serve the intent. When no skill matches any evaluation, the result is intent_mismatch.

Discovery at a glance: three yes/no questions per skill. The picture draws skills of two agents side by side to show a match and two misses; a gateway asks the questions of the skills of its own agent.

Discovery runs over all skills of a capability, before any id is known, and compares types only. For every evaluation of the intent and every skill:

  • A mapping matches an evaluation when the evaluation's subject type equals the type of one of the mapping's subjects, its resource type equals the type of one of the mapping's resources, and its action name is one of the mapping's actions, or the mapping lists none.
  • A skill matches an evaluation when at least one of its mappings does.
  • The decision is positive when at least one skill matches at least one evaluation. Evaluations no skill matches do not make it negative. An intent without evaluations matches nothing and is negative.
  • The response lists, for every evaluation in order, the ids of the skills that matched it, in the order of the capability's skills, empty when none did.

With a capability of two skills, read-document mapped to Person → read → Document and share-document mapped to Person → share → Document, an intent with the evaluations Person → read → Document and Person → delete → Document is positive with reason code intent_match_search: the first evaluation matched ["read-document"], the second []. An intent whose only evaluation is Person → delete → Document is negative with intent_mismatch and the reason Skill or Tool intent does not match the Prompt intent.

Usage: confirm one skill and derive the AuthZEN requests

Usage, for a call of the tool read_document by roy. Three inputs: the call, tools/call read_document with the argument docId doc-1; the delegation token, whose sub is roy; and the current intent, Person read Document. The mapping of the tool declares the resource Document with the id $request.arguments.docId, the subject Person with the id $token.sub, and the action read. Its types and action match the intent, and its references are read from the call and the token, never from the intent. One evaluation is resolved: Person roy, read, Document doc-1. The platform decides it with POST /access/v1/evaluations: allowed, the call goes on; denied, the call is refused with 403. Two other cases: a mapping that declares no id resolves nothing and is a search match; a reference that has no value means the mapping does not match and the call is refused.

Usage at a glance, with the worked example below: from a call to one resolved evaluation, decided by the platform.

Usage runs on a capability holding exactly one skill, the one discovery resolved, together with the parameters of the call. Any other number of skills is refused with incorrect_num_skills and the reason Capability does not contain exactly 1 skill. For every evaluation of the intent and every mapping of the skill:

  • The mapping matches on types and action exactly as in discovery.
  • On a match, every mapping subject of the evaluation's subject type and every mapping resource of its resource type is resolved: a literal id is kept, a $ reference is looked up in the parameters. Every reference of the mapping must resolve, on its subjects and on its resources alike: a mapping with one that does not resolve does not match.
  • One AuthZEN request is produced per resolved subject and resource pair: {subject: {type, id}, action: {name}, resource: {type, id}, context: {input_params: <the parameters>}}, with the action of the evaluation. The ids come from the mapping, never from the intent: the prompt cannot name a subject the mapping does not resolve.
  • Only requests with a subject id, a resource id and an action name are kept for the decision; a mapping entity that declares no id, or an evaluation without an action (an action search), matches without producing one. That is a search match, and it is deliberate: the mapping says the capability works on whichever resource the caller may reach. A reference that fails to resolve is the opposite case: the mapping declares an id, the call does not supply it, and the mapping does not match.
Outcome Decision Reason code Then
At least one evaluation matched and at least one complete request was producedtrueintent_match_authzen_requiredSend each generated request to POST /access/v1/evaluation, or all of them to POST /access/v1/evaluations; the skill id travels with them.
At least one evaluation matched, no complete requesttrueintent_match_searchThe match needs a search rather than a decision: POST /access/v1/search/resource, /search/subject or /search/action, as in the Intent Agent guide.
No evaluation matchedfalseintent_mismatchRefuse.

Worked example

The MCP tool above, called by roy with the prompt "Read the document doc-1". The Intent Agent answers one evaluation; the parameters carry the token claims and the tool arguments:

{
  "prompt": "Read the document doc-1",
  "evaluations": [
    {
      "subject": { "type": "Person", "id": "roy" },
      "action": { "name": "read" },
      "resource": { "type": "Document", "id": "doc-1" },
      "context": { "parameters": {} }
    }
  ]
}
{
  "token": { "sub": "roy" },
  "request": { "arguments": { "docId": "doc-1" } }
}

The mapping matches: Person, Document, read. $token.sub resolves to roy and $request.arguments.docId to doc-1, so the decision is true with intent_match_authzen_required and one request for skill read-document:

{
  "subject": { "type": "Person", "id": "roy" },
  "action": { "name": "read" },
  "resource": { "type": "Document", "id": "doc-1" },
  "context": {
    "input_params": {
      "token": { "sub": "roy" },
      "request": { "arguments": { "docId": "doc-1" } }
    }
  }
}

Had the tool been called without docId, the reference would have no value, the mapping would not match, and the decision would be false with intent_mismatch: a call cannot skip the check by leaving out the argument the mapping reads. Had the prompt asked to share the document, no mapping would match and the decision would be false with intent_mismatch.

Reason codes

Code Decision Written by Meaning and reason text
intent_match_searchtruediscovery, usageDiscovery: at least one skill matched. Usage: matched, no complete request; run a search.
intent_match_authzen_requiredtrueusageMatched with requests to decide at AuthZEN.
intent_mismatchfalsediscovery, usageNo skill matched any evaluation. Discovery adds the reason Skill or Tool intent does not match the Prompt intent.
missing_coaz_mappingfalsediscovery, usageNo skill of the capability declares a mapping. Reason Capability intent does not match the Prompt intent.
incorrect_num_skillsfalseusageThe capability does not hold exactly one skill. Reason Capability does not contain exactly 1 skill.
invalid_intentfalsediscovery, usageThe intent breaks a rule of its shape; the reason is the validation message.
invalid_capabilityfalsediscovery, usageA skill or mapping breaks a rule of its shape; the reason is the validation message.
intent_match, invalid_coaz_mapping, internal_errorneitherDefined codes that discovery and usage do not write.

Audit records

Every evaluation writes one record in the gateway's flat audit format, with action IBAC_DISCOVERY or IBAC_USAGE and decision AUTHORIZED for a positive evaluation, NOT_AUTHORIZED for a negative one. These are the records the capabilityName, skillID, reasonCode, skillIDs and evaluations columns exist for.

The gateway's mapping check in front of an MCP server writes IBAC_USAGE records too, one per checked invocation, with the named capability in capabilities, the outcome in reason, and reasonCode missing_coaz_mapping or invalid_coaz_mapping when the mapping is absent or unreadable. A call checked against the intent also gets the engine's own IBAC_USAGE record, with reasonCode intent_match_authzen_required, intent_match_search or intent_mismatch. A call with resolved evaluations gets one more record, with action RESOLVED_EVALUATIONS: every evaluation the gateway sent to the platform, with the platform's answer for each. The records of a request with an intent carry currentIntent and originalIntent. The reason strings are listed in the Agent Gateway guide. Its filtering of an extended agent card in front of an A2A agent writes IBAC_DISCOVERY records: the engine's own for the skills with a mapping, and one each for the skills without a mapping and the skills with an unreadable one, with the skill ids in skillIDs and reasonCode missing_coaz_mapping or invalid_coaz_mapping.

Field IBAC_DISCOVERY IBAC_USAGE
capabilityNameThe name of the capability evaluated.The same.
skillIDsThe ids of all skills of the capability, in the order given.Absent.
evaluationsOne entry per evaluation of the intent: {subjectType, resourceType, action, matchedSkills}, matchedSkills the ids of the skills that matched it, [] when none.Absent.
skillIDAbsent.The id of the one skill; empty when the capability did not hold exactly one.
reasonCodeAbsent.The reason code of the decision.
reasonThe reason text of the code, empty on a match.The same.
prompt, subject, actor, actorsChainSupplied by the gateway for the request the evaluation belongs to, under the same rules as its other records.The same.
{
  "decision": "AUTHORIZED",
  "reason": "",
  "subject": "roy",
  "actor": "docs-agent",
  "action": "IBAC_DISCOVERY",
  "service": "docs-iag",
  "timestamp": "2026-11-05T09:12:00.123456789Z",
  "traceID": "4bf92f3577b34da6a3ce929d0e0e4736",
  "capabilityName": "Docs",
  "skillIDs": ["read-document", "share-document"],
  "evaluations": [
    { "subjectType": "Person", "resourceType": "Document", "action": "read", "matchedSkills": ["read-document"] },
    { "subjectType": "Person", "resourceType": "Document", "action": "delete", "matchedSkills": [] }
  ],
  "actorsChain": ["docs-agent"]
}

In csv and txt files the five columns follow prompt, lists written as JSON; the column order and the quoting rules are in the Audit Event Formats guide.

Related