Skip to main content
A policy is an ordered list of rules. The first rule that matches a tool call wins. If no rule matches, the default_verdict applies.
Plyra Guard Policy Flow

YAML policy

Policies are defined in your guard_config.yaml file. Each policy has a name, a list of action types to match, a condition expression, and a verdict:

Policy fields

Verdict types

Default verdict

Always set default_verdict: BLOCK in production. This fails closed — any tool call that doesn’t match a policy rule is blocked. Unmatched calls are the most common source of unexpected agent behaviour.

Risk levels

The RiskLevel enum sets a baseline risk score for a protected action. The dynamic risk scorer adjusts it based on context (agent trust, parameters, etc.).

Trust levels

The TrustLevel enum classifies agents in multi-agent systems. Trust determines what risk thresholds an agent can execute under.

Dry-run evaluation

Test a policy without executing anything:
guard.evaluate() takes an ActionIntent object, not a plain string. See the API reference for all ActionIntent fields.

Real-world policy example

A policy for a database agent that can read freely but must escalate any destructive operation and block schema changes entirely:
Rules are evaluated top to bottom. A SELECT query matches the first rule and is allowed immediately. A DELETE matches the second rule and is paused for approval. A DROP TABLE matches the third rule and is blocked outright. Any query that matches none of the rules hits the default_verdict: BLOCK.