Skip to content

Boundaries

A boundary is a set of rules that limit what callers and agents can do in conversations. A rule can refuse a new conversation or request, keep a tool or skill from an agent, refuse a tool call, or make a tool call wait for the user to approve it. A boundary can also set tags, tracing and tool arguments.

Boundaries only take away. The configuration of a mesh says what agents get, and boundaries limit that. Everything is allowed unless a rule refuses it.

To create a boundary, open Access > Boundaries and press New boundary. Edit the rules and modifications as cards, or switch to JSON. Then attach the boundary to a mesh or an access point.

Quick Reference

Settings

FieldPurposeGuidance
NameIdentifies the boundary

Name it for what it protects, for example “support-agents” or “refund-limits”. Decisions and refusals name the boundary.

DescriptionNotes

Optional. Say what the boundary is for and who owns it.

Report onlyTry a boundary out

Every rule records what it would refuse and refuses nothing, and no modification is made. Turn it on for a new boundary, read the decisions, then turn it off.

Rule

FieldPurposeGuidance
NameIdentifies the rule

Unique in the boundary. Decisions and refusals name the rule.

ActionWhat the rule checks

One of the actions.

WhenWhen the rule applies

A CEL expression that gives true or false. Left empty, the rule applies to every action of its kind.

EffectWhat the rule does when it applies

Deny refuses the action. Ask makes a tool call wait for the user to approve it, and is only for Tool call.

MessageTold to whoever is refused

Optional. Shown to the caller, the agent or the user who approves. It can embed CEL as ${...}, for example Use the prod version of ${mesh.name}. Write $${ for a literal ${. A value that is not a string is shown as JSON, and an expression that fails is shown as ?.

Report onlyTry one rule out

The rule records what it would refuse and refuses nothing.

Modification

FieldPurposeGuidance
NameIdentifies the modification

Unique in the boundary, among rules and modifications.

ActionWhat the modification sets things on

Conversation create, Request create or Tool call.

WhenWhen the modification applies

A CEL expression that gives true or false. It can’t read a tool call’s arguments. Left empty, the modification applies to every action of its kind.

Set tagsTags of a new conversation or request

For Conversation create and Request create. Each tag name has an expression that gives its values. A string sets one value, a list sets several, and an empty list removes the tag. The values replace any the caller sent for that name.

Set tracingWhether a new conversation is traced

For Conversation create. An expression that gives true or false.

Set argumentsFixed tool arguments

For Tool call. Each argument name has an expression that gives its value. The model doesn’t see an argument that a boundary sets.

Where a boundary applies

Attach a boundary to a mesh or to an access point.

  • Mesh. On the mesh settings page, add it under Boundaries. It applies to every conversation on the mesh, for every version and every caller.
  • Access point. On the access point page, add it under Boundaries. It applies to everything in the conversations that are created through the access point: the conversation, each request, and every step the agents take.

A conversation is checked against the boundaries of its mesh and of the access point it was created through. A boundary attached to both is checked once.

Conversations that a webhook or a schedule starts skip the Conversation create and Request create checks. The configuration decides how they start, not a caller. The other actions are still checked.

Actions

Each rule checks one action. The action sets which variables the rule’s expressions can read.

ActionRuns whenVariables
Conversation createA caller creates a conversation through the Conversation API, AG-UI or MCP.mesh, route, conversation, caller
Request createA caller sends a request, including the first one of a conversation.mesh, route, intent, conversation, request, caller
Skill provideBefore each step of an agent, for each skill the agent could get.mesh, skill, conversation, request
Tool provideBefore each step of an agent, for each tool the agent could get.mesh, tool, conversation, request
Memory search provideBefore each step of an agent, for each memory search whose results the agent could get.mesh, memory_search, conversation, request
Conversation history provideBefore each step of an agent, when the agent could get the conversation history.mesh, conversation_history, conversation, request
Tool callWhen the model calls a tool.mesh, tool, arguments, conversation, request

The provide actions and Tool call run in the background, so they have no caller. To limit what a caller’s agents can do, set tags when the conversation is created, and check the tags in later rules.

Variables

Tags are a map from each tag name to a list of values, for example conversation.tags["user"].

VariableFields
meshid, name, tags, version (a number), version_label (empty when there is none), draft (true or false)
routeid, name. It is null when the caller names a mesh version instead of a route.
intentname
conversationtags, external_id, tracing (true or false)
requesttags
callerkind: api_key, user (a person signed in to the console) or access_point. access_point: its id and tags, only when the caller came through one. subject and claims: from the caller’s token, empty for an API key.
skillid, name
toolname, as the agent sees it. source: kind (mcp, particle, client_task, resource_reader, skill or memory), and the id and name of the MCP connection, installed particle or interaction profile it comes from. memory: the operation (query, write or expand), only for a memory tool.
memory_searchname, and the profile it is from, with id and name
conversation_historyThe profile that asks for it, with id and name
argumentsThe arguments of the tool call, as a JSON object

Writing expressions

Expressions are CEL. A rule’s When must give true or false. Some examples:

  • mesh.version_label == "prod"
  • "admin" in caller.claims.roles
  • tool.source.kind == "mcp" && tool.name.startsWith("delete_")
  • "pii" in mesh.tags

You can also use the CEL string functions, such as lowerAscii() and split(), and list.only(), which gives the one value of a list. For example, conversation.tags["customer"].only() gives the customer tag’s value, and fails when there are no values or more than one.

An expression that fails refuses the action. Reading something that isn’t there fails. For example, reading a claim the token doesn’t have, an argument the call doesn’t have, or a field of route when route is null. Check first:

  • has(caller.claims.roles) && "admin" in caller.claims.roles
  • has(arguments.amount) && arguments.amount > 100
  • route != null && route.name == "canary"

Tags are the exception. A tag name that isn’t there reads as an empty list, so "support" in conversation.tags["team"] is false when there is no team tag. To test whether a name is there, write "team" in conversation.tags. only() on an empty list fails.

You can also read with .? and give a default, for example caller.claims.?team.orValue("none").

When you save a boundary, the page warns you about reads like these. The warnings are also listed on the boundary.

How rules decide

Every rule for the action is checked. Rules are checked in order: by boundary name, then by their place in the boundary.

  1. If a rule that denies applies, or an expression fails, the action is refused. The first such rule gives the message.
  2. If no rule refuses, and a rule that asks applies, the tool call waits for the user to approve it.
  3. Otherwise the action is allowed.

A rule or boundary in report-only mode never refuses or asks. It records what it would have done.

What a refusal looks like

ActionWhen a rule refuses it
Conversation create, Request createThe API answers 403 with a problem document. The detail is the rule’s message, and decision_id is the decision ID. For a caller that came through an access point, the boundary and rule names are left out. The list of a conversation’s intents leaves out the intents a caller can’t use.
Skill provide, Tool provide, Memory search provide, Conversation history provideThe agent doesn’t get it for that step. Nothing is recorded.
Tool call, DenyThe tool isn’t called. The agent gets an error with the rule’s message and the decision ID, as it would get any tool error.
Tool call, AskThe request waits. It gets a task of kind tool_call_approval, with the tool, the arguments, the rule’s message and the decision ID. Approve it with {"approved": true}. Decline it with {"approved": false}, and add a comment for the agent if you like. Cancelling the task declines the call. See Client Tasks and AG-UI. In Converse, approve or decline the call in the transcript.

Modifications

A modification sets something on an action that the rules allowed:

  • Set tags sets the tags of a new conversation or request. For example, set user to caller.subject, so that a caller can’t choose whose memories apply. Memory reads the conversation tags and the request tags together, so also remove user from each request. The examples below show both.
  • Set tracing decides whether a new conversation is traced.
  • Set arguments fixes an argument of a tool call. The model doesn’t see the argument, and the mesh sets it when the tool is called. Before the call, the argument is checked against the tool’s input schema. An argument the tool doesn’t take refuses the call.

Modifications run only after the rules allow the action. They run in order: by boundary name, then by their place in the boundary. Each one sees what the ones before it set. Rules always read what the caller or agent sent, not what modifications set. A modification that fails refuses the action. A boundary in report-only mode makes no modifications.

Decisions

A decision is the record of one check. These are recorded:

  • Refused conversations, requests and tool calls
  • Tool calls that wait for approval
  • Actions that report-only rules would have refused, or made wait

The decisions of the provide actions are not recorded.

To see a decision, open Access > Decisions and enter its ID. The ID starts with rbpd_. Callers, agents and approval tasks get the ID. The decision shows:

  • The outcome, and the rule that decided it, with its message
  • Every rule for the action, and whether it applied or failed
  • Each modification, and what it set
  • The values the expressions read

To test a boundary before you use it, turn on Report only and read the decisions. Or run the GraphQL query explainBoundaryDecision. It checks an action you describe against the boundaries that would apply, and runs nothing.

Examples

Each example is one entry of rules or modifications, as the editor’s JSON view shows it.

Only let callers that come through an access point use the prod version:

{
  "name": "prod-only",
  "action": "CONVERSATION_CREATE",
  "when": "has(caller.access_point) && mesh.version_label != \"prod\"",
  "effect": "DENY",
  "message": "Use the prod version of ${mesh.name}."
}

Keep the delete tools of an MCP connection named github from every agent:

{
  "name": "no-github-deletes",
  "action": "TOOL_PROVIDE",
  "when": "tool.source.kind == \"mcp\" && tool.source.name == \"github\" && tool.name.startsWith(\"delete_\")",
  "effect": "DENY"
}

Ask the user before a refund over 100:

{
  "name": "large-refunds",
  "action": "TOOL_CALL",
  "when": "tool.name == \"issue_refund\" && has(arguments.amount) && arguments.amount > 100",
  "effect": "ASK",
  "message": "Refunds over 100 need approval."
}

Take the user tag from the caller’s token:

{
  "name": "user-from-token",
  "action": "CONVERSATION_CREATE",
  "when": "caller.kind == \"access_point\"",
  "setTags": [{ "name": "user", "expression": "caller.subject" }]
}

Remove any user tag the caller sends with a request. Without this, a caller could add user=bob to a request and read Bob’s memories as well. An empty list removes the tag:

{
  "name": "no-user-on-requests",
  "action": "REQUEST_CREATE",
  "when": "caller.kind == \"access_point\"",
  "setTags": [{ "name": "user", "expression": "[]" }]
}

Fix the customer of an order lookup to the conversation’s customer tag:

{
  "name": "own-orders-only",
  "action": "TOOL_CALL",
  "when": "tool.name == \"lookup_orders\"",
  "setArguments": [{ "name": "customer_id", "expression": "conversation.tags[\"customer\"].only()" }]
}

Limits

A boundary can have up to 1000 rules and 1000 modifications, and up to 32 KB of expressions. Each expression has a limit on how much work it can do.

Related

  • Meshes: attach boundaries in the mesh settings.
  • Access Points: attach boundaries to an access point, and read its tags and the caller’s claims.
  • Tags: how tags are sent and what reads them.
  • Conversation API: the 403 problem document.
  • Client Tasks and AG-UI: answer tool_call_approval tasks.
  • Configuration As Code: the partiteai_boundary resource, attached with boundary_ids on partiteai_mesh and partiteai_access_point.