execution_policy field of the object it governs: an agent definition, a session, or a batch definition. This guide covers setting a baseline policy on an agent, narrowing it per session, and scoping batch runs.
Prerequisites
- An agent with at least one datasource or MCP server tool. See Managing agents to create one.
- Your API key in the
MEIBEL_API_KEYenvironment variable.
ds_abc123 datasource and reaches its email and web search tools through an MCP server entry named acme.
Set a policy on an agent definition
A policy on the agent definition is the baseline for every session created against that agent. It is the place for constraints that should hold no matter who is using the agent: the tables it may query, the columns it must never return, and the tools it should not have at all. Set it when creating the agent.orders and customers tables, never sees the two hidden columns, and has no web search tool. Tools are addressed under the MCP server entry that provides them, keyed by the tool’s own name as the server reports it. See Tool constraints for how server entries and tool names line up.
The platform checks every table, column, metadata field, server entry, tool, and parameter the policy names against the agent’s real schemas before the first LLM call. A reference that does not exist stops the session from starting, with an error listing every problem.
Change an agent’s policy
Tighten or relax the baseline by updating the agent with a newexecution_policy. Send the complete policy you want the agent to carry. The update below keeps the datasource scoping and adds a locked recipient on the email tool.
Narrow a session
Per-user scoping happens at session creation. The agent’s policy stays fixed, and each session adds the constraints that belong to the user behind it: the region they may see, the documents they own, the limits on what a tool may do on their behalf. The session below restricts one user to EU orders and two documents, and caps how many results any tool on theacme server may return.
$and, and a tool or datasource disabled at either level stays disabled. Composition only narrows, so a session can never reach data or tools the agent definition rules out. The global entry applies its constraint to every tool the acme server exposes that declares a count parameter, including tools added to the server after the policy was written. See Composing policies for the full merge rules.
Scope a batch definition
A batch definition carries its ownexecution_policy, applied to every item the batch processes. Set it when creating the definition to limit which input documents a run may touch and which tools it may call.
Next steps
Execution Policies
The full constraint syntax, enforcement model, and composition rules behind these examples.
Managing Datasource Metadata
Index the metadata fields a document filter can scope on.