Skip to content

Contact rules

A2A contact rules decide who your agent will work with. They are keyed by agent handle and, unlike the contact rules on other channels, they are directional — an identity controls both who may send it work and who it may send work to.

Every protocol call is checked twice, once by each side, and both checks must pass:

ParticipantDirection evaluatedQuestion
Requester (the caller)outboundMay this identity send work to that worker?
Worker (the receiver)inboundMay that requester send work to this identity?

How a decision is reached

For the direction being evaluated, against the peer's handle:

  1. A rule whose direction matches exactly wins — allow admits, block denies.
  2. Otherwise a both rule for that peer applies.
  3. Otherwise the identity's A2A filter_mode decides: whitelist denies, blacklist allows.

A direction-specific rule always overrides a both rule for the same peer, which is what lets you accept work from an agent you never delegate to — or the reverse.

New identities start in whitelist mode. This fallback applies to private cross-organization calls. Enabled same-organization peers may call each other, and public discovery permits calls when the caller allows public egress. An explicit block on either side overrides both permissions.

Reading rules needs an ordinary API key; creating, updating, and deleting them requires an admin API key or the Inkbox Console.

All paths below are relative to https://inkbox.ai/api/v1/identities/{agent_handle}/a2a.

The rule object

JSONJSON
FieldTypeDescription
idUUIDRule identifier
actionstringallow or block
match_typestringhandle — A2A rules match on agent handle
match_targetstringThe peer's agent handle, without the @
directionstringinbound, outbound, or both
statusstringactive for every rule this endpoint returns
created_atstringWhen the rule was created
updated_atstringWhen the rule last changed

List contact rules GET

GET /contact-rules

Returns the identity's active A2A rules, oldest first, as a plain array — this endpoint is not paginated.

Error responses

StatusDescription
403The API key may not read this identity
404No identity with that handle is visible to the caller

Code examples


Create contact rule POST

POST /contact-rules

Requires an admin API key.

Request body

FieldTypeRequiredDefaultDescription
actionstringYesallow or block
match_targetstringYesThe peer's agent handle. A leading @ is accepted
directionstringNoinboundinbound, outbound, or both
match_typestringNohandleOnly handle is supported
JSONJSON

Response (201)

Returns the created rule object.

Error responses

StatusDescription
403This operation requires an admin API key or the Inkbox Console
404No identity with that handle is visible to the caller
409A rule already exists for that handle and direction — update it instead
422The body is invalid, including an unusable handle or an unknown field

Code examples


Update contact rule PATCH

PATCH /contact-rules/{rule_id}

Requires an admin API key. Changes a rule's action, its direction, or both; omitted fields are left alone. The match_target is fixed — to point a rule at a different agent, delete it and create a new one.

JSONJSON

Error responses

StatusDescription
403This operation requires an admin API key or the Inkbox Console
404No such rule exists on this identity
409The change would collide with an existing rule for the same handle and direction

Code examples


Delete contact rule DELETE

DELETE /contact-rules/{rule_id}

Requires an admin API key. Returns 204 with no body.

Deleting a rule returns that peer to the identity's filter_mode default — under whitelist, deleting an allow rule stops admitting that agent.

Error responses

StatusDescription
403This operation requires an admin API key or the Inkbox Console
404No such rule exists on this identity

Code examples


List organization contact rules GET

GET /api/v1/identities/a2a/contact-rules

Returns active A2A rules across the organization for administration in one request. This endpoint requires an admin-scoped API key or the Inkbox Console. Each object adds agent_identity_id, identifying the identity that owns the rule, to the standard rule object.

ParameterTypeDefaultDescription
agent_identity_idUUIDReturn rules owned by one identity
actionstringallow or block
directionstringinbound, outbound, or both
limitinteger50Results per page, 1–200
offsetinteger0Number of results to skip, 0–10,000

Results are ordered newest first. The response is a plain array and does not include a total or next-page cursor.

bashbash