Policies
A policy is a rule the agent must respect, written as a condition and the action to take when that condition holds. Policies constrain behavior across every conversation regardless of which routine is running: what the agent must not disclose, how it handles a request it cannot fulfil.

Policies belong to the project, not to an agent. You write one here and attach it to any agent from the Context step of its configuration. A deployed agent evaluates its attached policies as conversations run, in batches sized by Policy batch size on the agent's Advanced step.
Writing a policy
Each context item holds a single policy, defined in YAML. Name and condition are required, along with at least one of action or tools. The condition describes the situation in plain language, and the action describes what the agent should do when it holds.

Four optional fields are available:
toolsnames the tools the agent should use when carrying out the action, written asintegration:tool_name.criticalityrecords the policy's severity.always_matchhas the policy evaluated on every turn rather than only when the context matches its condition.idanddescriptionare for your own reference, and leaving id out makes the policy's storage name its canonical identifier.
Insert template gives you the full shape with the optional fields commented out. Preview renders your YAML the way it will appear once saved, which is the quickest way to catch a mistake, and the schema is validated when you create.

Config is optional. It holds arbitrary JSON that travels with the version and is available whenever the policy is fetched, which makes it a place for metadata such as parameters your own tooling reads.
Associated Agents assigns a version to one or more agents while you save it. The agent label is written onto that version and the agent's configuration is updated to reference it, so an agent runs the version you assigned rather than automatically following the newest one. Assignments can be changed later.
Versions and labels
Every save creates a new version instead of overwriting the current one, and the panel on the left lists them all with the author and date. Each card also carries the labels on that version and the agents using it, so you can see which revision is actually in play before you change anything. A policy can be shared by several agents. Versions cannot be edited in place, which is what keeps the history trustworthy. New starts another version from the one you are viewing, and the commit message is what makes that history readable months later.

latest is applied automatically and always points at the newest version. Every other label is yours to create and move: the label control on a version opens Context version labels, listing the labels already in the project with a field for adding a new one. Labels are how you control which version gets fetched without touching the code that fetches it, and they are also what assigns a version to an agent.
The detail view
Five tabs sit above the content.
Context shows the item itself, rendered for its type.
Config holds the arbitrary JSON attached to this version.
Linked Generations lists the observations that used this version, with the same filters, columns, and export controls as Observability. This is how you tell whether a version is actually being exercised in production, and how it performs when it is.
Use Context gives you a ready-made Python snippet for fetching the item, either by label or pinned to a version number. Every context type is fetched with
get_promptand its full path, as inpolicies/brand-voice.Label History is an audit log of label movement: which label changed, whether it was added or removed, the version it landed on, who moved it, and when.
Metrics, in the top right, swaps the versions panel for a table comparing every version side by side: median latency, median input and output tokens, median cost, how many generations used it, and when it was first and last used. It is the fastest way to catch a version that got slower or more expensive before you promote it.
Last updated
Was this helpful?

