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
| Field | Purpose | Guidance |
|---|---|---|
| Name | Identifies the boundary | Name it for what it protects, for example “support-agents” or “refund-limits”. Decisions and refusals name the boundary. |
| Description | Notes | Optional. Say what the boundary is for and who owns it. |
| Report only | Try 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
| Field | Purpose | Guidance |
|---|---|---|
| Name | Identifies the rule | Unique in the boundary. Decisions and refusals name the rule. |
| Action | What the rule checks | One of the actions. |
| When | When the rule applies | A CEL expression that gives true or false. Left empty, the rule applies to every action of its kind. |
| Effect | What 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. |
| Message | Told to whoever is refused | Optional. Shown to the caller, the agent or the user who approves. It can embed CEL as |
| Report only | Try one rule out | The rule records what it would refuse and refuses nothing. |
Modification
| Field | Purpose | Guidance |
|---|---|---|
| Name | Identifies the modification | Unique in the boundary, among rules and modifications. |
| Action | What the modification sets things on | Conversation create, Request create or Tool call. |
| When | When 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 tags | Tags 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 tracing | Whether a new conversation is traced | For Conversation create. An expression that gives true or false. |
| Set arguments | Fixed 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.
| Action | Runs when | Variables |
|---|---|---|
| Conversation create | A caller creates a conversation through the Conversation API, AG-UI or MCP. | mesh, route, conversation, caller |
| Request create | A caller sends a request, including the first one of a conversation. | mesh, route, intent, conversation, request, caller |
| Skill provide | Before each step of an agent, for each skill the agent could get. | mesh, skill, conversation, request |
| Tool provide | Before each step of an agent, for each tool the agent could get. | mesh, tool, conversation, request |
| Memory search provide | Before each step of an agent, for each memory search whose results the agent could get. | mesh, memory_search, conversation, request |
| Conversation history provide | Before each step of an agent, when the agent could get the conversation history. | mesh, conversation_history, conversation, request |
| Tool call | When 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"].
| Variable | Fields |
|---|---|
mesh | id, name, tags, version (a number), version_label (empty when there is none), draft (true or false) |
route | id, name. It is null when the caller names a mesh version instead of a route. |
intent | name |
conversation | tags, external_id, tracing (true or false) |
request | tags |
caller | kind: 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. |
skill | id, name |
tool | name, 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_search | name, and the profile it is from, with id and name |
conversation_history | The profile that asks for it, with id and name |
arguments | The 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.rolestool.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.roleshas(arguments.amount) && arguments.amount > 100route != 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.
- If a rule that denies applies, or an expression fails, the action is refused. The first such rule gives the message.
- If no rule refuses, and a rule that asks applies, the tool call waits for the user to approve it.
- 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
| Action | When a rule refuses it |
|---|---|
| Conversation create, Request create | The 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 provide | The agent doesn’t get it for that step. Nothing is recorded. |
| Tool call, Deny | The 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, Ask | The 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
usertocaller.subject, so that a caller can’t choose whose memories apply. Memory reads the conversation tags and the request tags together, so also removeuserfrom 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
403problem document. - Client Tasks and AG-UI: answer
tool_call_approvaltasks. - Configuration As Code: the
partiteai_boundaryresource, attached withboundary_idsonpartiteai_meshandpartiteai_access_point.