Overview
Conventional LLM guardrails operate through prompting, which means they can be bypassed through prompt injection or jailbreaking. Execution policies are hardrails: constraints enforced by the platform infrastructure itself, outside the LLM’s execution path. The LLM cannot see, modify, or circumvent the authorization logic that drives an execution policy. An execution policy narrows what data and tools are available to an agent session. It cannot make new datasources or tools available; it can only restrict access within what the agent is already configured to use. A policy has two sections. Datasource constraints control access to the data the agent queries and retrieves. MCP server constraints control which tools are available and what parameter values they accept. Every tool is addressed under whatever provides it: a datasource tool under its datasource, and every other tool under the MCP server that exposes it. The central use case is per-user data scoping in a multi-tenant environment. A single agent can serve many users, each with different data access permissions. Rather than building separate agents for each user, you define one agent and pass a different execution policy when creating each user’s session. One policy might restrict a session to European customer data; another might restrict it to a single client’s documents. The agent definition stays the same, and the policy controls what each session can see.Datasource constraints
Each entry in thedatasources section is keyed by datasource ID and controls what the session can access within that datasource. A datasource can be disabled entirely by setting disabled to true, which blocks all queries against it.
For datasources that remain enabled, constraints are split into two categories that match the two ways an agent accesses data: table queries and document retrieval.
Table constraints
Table constraints scope the SQL queries an agent can run against a datasource’s structured data. They have three parts. Filters narrow which tables and rows are accessible. Every filter key names a table:table.__name__ is the built-in field for table-level scoping, and table.column scopes rows by a column’s value. A bare column name with no table prefix is rejected, because the platform cannot tell which table it belongs to. Table and column names are written exactly as they appear in the schema, and names containing spaces, hyphens, or reserved words need no quoting.
orders and customers tables, and within orders, only rows where region is EU and amount is at least 100. The platform enforces these constraints transparently, so the agent only ever sees rows that match.
Row filters are applied to each table independently, so $or and $not can combine conditions within one table but cannot span two. A policy whose $or names columns on different tables fails validation. The $and operator has no such limit.
Hidden columns remove specific column values from query results, per table. The platform removes hidden columns from the schema the agent sees, so the agent has no reason to reference them. If generated SQL references one anyway, the column still works in WHERE and JOIN clauses, and only its values are stripped from the output.
Document constraints
Document constraints scope which documents the agent can retrieve through vector search. Their filter uses the same operator syntax as table constraints, with built-in fields for document identity:data_element.__id__scopes by data element IDdata_element.__name__scopes by original filename
product_line is a custom metadata field:
$or and $not can combine any fields freely.
Tool constraints
Each entry in themcp_servers section is keyed by the name of an MCP server entry in the agent’s tool configuration. Within it, tools holds one entry per tool, keyed by the tool’s own name as the server reports it. The server entry already scopes the tool, so the key is unprefixed: a policy writes atlassian-search under the atlassian server, even though the agent calls the tool as atlassian__atlassian-search.
A tool can be disabled entirely by setting disabled to true, which removes it from the agent’s available toolkit. For tools that remain enabled, the variables field constrains parameter values. Every parameter stays visible in the tool’s schema, including one pinned to a single value, because the agent needs the whole signature to decide whether to call the tool. What a constraint changes is the parameter’s description: the platform appends the constraint in readable form, and then validates the agent’s value again when the tool is called.
Fixed values are plain values, which are shorthand for $eq. They constrain a parameter to a single allowed value.
to parameter must equal support@acme.com. If it provides any other value, the platform rejects the call.
Range constraints use operators like $lte, $in, or $contains. They work the same way: the parameter description is annotated with the constraint, and the platform validates the agent’s value at execution time.
query and count, but the platform rejects any search query that does not include site:acme.com and any count above 10.
A constraint binds a parameter’s value when the agent supplies it. It does not make the parameter required: if the agent omits the parameter, there is no value to check and the call proceeds.
Server-wide constraints
An MCP server’s tool catalog lives on the server, and the tools it exposes can change after a policy is written. A policy that names tools individually cannot cover a tool added later. Theglobal entry on a server applies to every tool the server exposes, including tools that did not exist when the policy was written.
global onto each of the server’s tools before enforcement, as if the constraint had been written on every tool. A parameter the global names is applied only to tools that declare it, and dropped for the rest, so one constraint can reach a server’s whole catalog without every tool sharing the same signature. A per-tool entry composes with the global, so it can only narrow the server-wide rule. Setting disabled to true under global removes every tool the server provides.
A global must be flat: parameter names mapped to constraints. Cross-parameter logic with $and, $or, or $not at the top level of variables belongs on individual tools, where the parameter set is known.
Constraint syntax
All constraints, whether on datasource filters or tool parameters, use the same operator vocabulary. A constraint is a JSON object whose keys are$-prefixed operators. A plain value is shorthand for $eq, and multiple operators in the same object are implicitly combined with $and.
The built-in fields
table.__name__, data_element.__id__, and data_element.__name__ accept only the equality and set operators.
Nested values. A filter can reach into a structured column or metadata field by nesting field names, and into a list with the list quantifiers. $elemMatch requires some element to match, $allElemMatch requires every element to match, and $noElemMatch requires none to. The size operators bound how many elements a list holds. An empty list satisfies both $allElemMatch and $noElemMatch, so a policy that means “at least one, and all of them qualify” pairs the quantifier with $minSize.
null operand matches the absence of a value. It is valid with $eq, $ne, $in, and $nin, and translates to IS NULL on table queries. Only a literal JSON null has this meaning; the string "null" is compared as text.
Table queries and document retrieval read deny lists differently when a value is null. In SQL a null never satisfies a comparison, so
$nin and $ne on a table filter exclude rows where the column is null. A document whose field is null or missing survives the same $nin and stays visible. A policy that must behave identically on both states the intent, combining the deny list with { "$eq": null } or { "$ne": null } through $or or $and.How enforcement works
Execution policies are hardrails, enforced at three points in a defense-in-depth model that operates around the LLM rather than relying on it. Before the LLM call. The platform builds the agent’s tool schemas and datasource schemas according to the policy. Disabled tools, inaccessible tables, and hidden columns are removed from the schemas the agent sees. Constraint descriptions are annotated into parameter descriptions so the agent understands the boundaries it must operate within. During data access. When the agent queries a datasource, the platform applies the policy’s filters to the query itself. For table queries, the platform parses the generated SQL and wraps every table reference, including those inside joins, subqueries, and common table expressions, in a filtered subquery, so only matching rows are returned. For document retrieval, filter conditions are added to the vector search query. The agent receives only data that passes the policy’s filters. At tool execution. When the agent invokes a tool, the platform validates every argument against the policy’s constraints before dispatching the call. If any argument violates a constraint, the call is rejected and the agent receives a generic error. The error does not say which constraint failed or what value would have passed, so the agent cannot probe the policy through its own tool calls. This model means policies cannot be circumvented through prompt injection or creative instructions. The LLM never sees the authorization data that drives datasource scoping. Tool constraints are validated outside the LLM’s execution path. Enforcement fails closed. A table query that cannot be scoped, because the SQL does not parse or the policy cannot be translated for it, does not run. A tool argument whose type does not fit its constraint is treated as a violation.Before the agent’s first LLM call, the platform checks every reference in the effective policy against the real schemas: table and column names, document metadata fields, MCP server entries, tool names, and parameter names. If any reference does not exist, the session fails to start with an error listing every problem, so a typo in a policy surfaces before the agent runs.
Composing policies
A policy can be set at two levels, and both are written inline as theexecution_policy field of the object they belong to:
- Agent definition: the policy on the agent, applied to every session created against it. A batch definition carries its own policy in the same way.
- Session creation: the policy passed when creating a session, layered on top of the agent’s policy.
$and, so the data or parameter must satisfy both. If any level disables a datasource or tool, it stays disabled in the result. There is no priority or overriding between levels.
Because composition only narrows access (filters intersect, disabled is sticky), a session-level policy cannot grant access beyond what the agent definition allows. Each layer can only further restrict the previous one. Two levels that fix the same parameter to different values produce a constraint nothing can satisfy, and the platform rejects every call to that tool for the session.
Related concepts
Execution policies interact with other parts of the platform:Datasources
The datasources whose documents and tables a policy scopes, and the metadata it filters on.
Agents
The agents that execution policies constrain, including their datasource bindings and tool configurations.
Batch Jobs
Running agents at scale with execution policies applied to each batch execution.