Policies

Preventive policies can deny or reshape this LLM or tool call. Detective policies record after traces land. Ingest never rejects a trace.

Policies are named rules you set in the Traccia app. Get your API key from app.traccia.ai only.

Every policy is either Real-Time (it can stop a call) or After Run (it records and alerts). The table below shows the difference. Ingest never rejects a trace because of a policy.

Policies Section
Policies Section

Policies vs Compliance Hub

Policies are automated rules, Decision Log rows, and violation tickets. Human review queues, the AI system registry, incidents, and compliance evidence exports live in the Compliance Hub. Guardrail Posture is a separate, read-only view of detector signals on traces. See Guardrail Posture.

Preventive vs Detective

TypeWhen it runsWhat Block doesWhere you look
Real-Time (Preventive)Before each LLM or tool call, through @govern() and auto-instrumented spans, or through the Gateway for Spend Cap and Model Boundary.Deny or reshape this call. Observe and Warn still let the call through and record a match.Decision Log. No Violations tab. Remaining budget for Spend Cap is on the agent Cost and Attribution module.
After Run (Detective)After the trace is ingested, or on a rolling window (Hourly, Daily, or Weekly) using AVG, SUM, MAX, MIN, P95, or similar.Arm the next @govern() wrap. The run that already finished is not undone. Traces are still accepted.Violations (the to-do list) and Decision Log (the history). Evaluate Now can replay Per Trace rules.

Scope a policy to the organization, a workspace, or one agent. Agent scope uses the Agent ID you pass to init() (or TRACCIA_AGENT_ID). You can reserve that ID before the first trace. The reserved name shows as Declared on Agents until a successful ingest promotes it.

Templates

Create Policy opens What Do You Want To Protect? The templates are grouped the same way as the table above. Back returns you to Policies.

Real-Time (Preventive)

These run before the call finishes. Open one to see what it does, what you set, and what your agent has to send. Spend Cap and Model Boundary also work through the Gateway. The rest need the SDK and govern().

After Run (Detective)

These check traces after they land and open a violation when a limit is crossed. They do not undo the run that already finished. Each one starts from sensible values you can change.

Error rate is not a policy metric yet. Observe, Warn, and Block are available on every template, but they do not mean the same thing for Preventive and Detective rules.

Draft, Activate, And Enforcement

The wizard is three steps: pick a template, configure (name, scope, rules, mode, notifications), then Review. Review has two save actions: Save Draft and Activate Policy. Draft is stored and not evaluated. Activate turns the policy on with the mode you set on Configure.

ChoiceWhat happens
Save DraftStore the policy. It does not evaluate until you activate it.
Activate PolicyTurn the policy on with the enforcement mode you picked.
ObserveLog matches. Email if Alerts is On. Does not stop the agent.
WarnSame logging, with Would-Have recorded. Preventive templates continue this call. Detective templates warn on the next @govern() wrap. Traces are still accepted.
BlockPreventive templates deny or reshape this LLM or tool call. Detective templates stop the next @govern() wrap. Traces are still accepted.

Preventive Block raises AgentBlockedError on this call when the SDK cannot reshape. Remaining budget is on the agent Cost and Attribution module. Detective Warn and Block stay lagged through @govern().

Graduated Escalation

Graduated Escalation is marked Coming Soon and is not enforced.

Simulate Last 7 Days

On Review, run Simulate Last 7 Days before you turn the policy on. Traccia replays the draft against last week's traces and reports how many matched, for example 12 of 847 traces matched this draft. Simulate does not save the policy. A large replay is capped at 5,000 traces in this request.

Decision Log

Open Decision Log from Policies. This is the history of evaluations, grouped by trace, including quiet No Match rows so you can see the rule is working, not broken. Each row shows the Mode that was in force at check time (Observe, Warn, or Block). Violations stay the to-do list for Detective policies.

BadgeMeaning
MatchedThe rule matched this run. Helper: Detected only. This run was not stopped.
No MatchThe rule was evaluated and did not match.
DeniedThis LLM or tool call was denied under Preventive Block. Remaining budget is shown when present.
ReshapedThis call continued on a cheaper or fallback model.
QueuedRefund Guard or Purchase Guard held this call for a person. The tool did not run.

Each row shows the agent name with a smaller agent ID, and a trace link to the run. Span detail shows the same Matched or No Match badge when a stored span has policy attributes.

Violations

Detective policies have a Violations tab. Preventive policies do not open violations. Expand a row to see how the metric was calculated and the lifecycle events for that row.

StatusMeaning
OpenThe rule was exceeded and the row still needs attention.
AcknowledgedSomeone reviewed the row. Trace events stay on the record.
ResolvedA person closed an Aggregate row.
Auto ResolvedAn Aggregate window metric fell back within the limit in the same evaluation window.
  • Per Trace rows: use Acknowledge when reviewed. You cannot Resolve them. A later compliant trace does not close an earlier Open row.
  • Aggregate rows: Acknowledge or Resolve. Auto Resolve only applies to the current window, and the lifecycle shows why it cleared (the value at Auto Resolve when that value was recorded).

The Policies list shows Active Policies, Open Violations, Enforced Agents (agents with at least one Open violation), and a Severity Breakdown of those Open rows. Click a card to open that list.

On an active Detective Per Trace policy, Evaluate Now replays the rule against recent traces and opens missing violation rows. Preventive policies do not offer Evaluate Now. When a Detective Warn or Block has armed the next wrap, the policy Decisions tab lists those Next Run Stops with a trace link for that wrap.

Email Alerts

Email Alerts sit on the policy and default to Off. Detective policies email after a violation becomes Open, usually within about 30 seconds. Preventive policies email after a deny, reshape, or Would-Have match. Repeat mail for the same Open Detective row waits for the policy Cooldown Period. Acknowledged, Resolved, and Auto Resolved rows do not send.

PlanWho receives mailDaily cap (UTC)
SoloYour verified account only.20
TeamOrganization admins.50
EnterpriseUp to 10 verified members you select on the policy.200

Test emails share the same daily cap. Recipients must be verified members of the organization. There is no free-text address field.

Creating a Policy

  1. Go to Policies in the app.
  2. Click Create Policy.
  3. Pick what you want to protect. Back returns you to Policies.
  4. Set name, scope (organization, workspace, or Agent ID), rules, Observe / Warn / Block, and Email Alerts.
  5. On Review, optionally Simulate Last 7 Days, then Save Draft or Activate Policy.

Stop this call

Wrap the agent entry point with @govern() (Python) or govern() (TypeScript), set agent_id on init() only, use auto-instrumented LLM and tool spans, and activate a real-time policy in Block. You do not add a separate check() in agent code. Get your API key from app.traccia.ai.

Next Steps

© 2026 Traccia.