Skip to main content

Managing Execution Policies

Execution policies are hardrails that limit what data and tools an agent session can access, enforced by the platform rather than by the LLM. You can store policies as named, reusable objects and then apply them when creating sessions, defining agents, or running batch jobs. This guide covers the full lifecycle: creating policies, managing them, and applying them to agent executions.

Create an execution policy

Create a stored execution policy by providing a name and the policy payload. The policy defines datasource constraints, tool constraints, or both.
The response includes the policy’s id, name, description, execution_policy, and timestamps. Use the id for all subsequent operations.
Policy names must be unique within your project. Creating a policy with a name that already exists returns an error.

List execution policies

Retrieve all execution policies in your project.

Get execution policy details

Retrieve a specific execution policy by ID.

Update an execution policy

Modify a policy’s name, description, or constraints. Only the fields you include in the request body are changed.

Delete an execution policy

Remove an execution policy. The policy is soft-deleted and no longer appears in list results.
Deleting a policy does not retroactively affect sessions or executions that already used it. Those sessions retain the policy that was composed at creation time.

Apply policies to a session

Pass stored policy IDs, an inline policy, or both when creating a session. When both are provided, they are composed together.
You can also pass an inline policy directly, which is useful for per-user constraints that do not need to be stored:
When you pass both execution_policy_ids and execution_policy, the stored policies are resolved first, then the inline policy is composed on top. All filters are merged with $and semantics, so the effective policy is the intersection of all constraints.

Apply policies to an agent definition

Set default execution policies on an agent definition so they apply to every session created against that agent. These can be stored policy references, an inline policy, or both.
Definition-level policies compose with session-level policies when a session is created. The definition policies are applied first, then session-level policies are layered on top. Because composition only narrows access, session-level policies cannot grant access beyond what the agent definition allows.

Apply policies to a batch execution

Pass execution policies when executing a batch definition to scope the data each item in the batch can access.
As with agent sessions, batch-level policies compose with any policies set on the underlying batch definition.