L1 anomaly control attaches a JSON rule set to an agent version (under Limits & safety). Rules apply only when the model attempts a tool that is already on that version’s operations allowlist. For why Guard exists and dashboard workflows, start with Guard overview.Documentation Index
Fetch the complete documentation index at: https://docs.phrony.com/llms.txt
Use this file to discover all available pages before exploring further.
How rules are evaluated
Phrony uses two complementary paths:- Inline checks — When the model tries to call a tool, the runtime evaluates the effective rule set before the call proceeds. The outcome can allow, block, pause for review, or end the session, depending on what matched.
- Follow-up correlation — The platform replays the same rule definitions against recorded events so per-run / per-session counters stay consistent and Guard incidents, alerts, and audits reflect the run. That path does not undo an inline decision after a call has already finished.
anomaly_review user task so someone can approve or reject before the tool runs.
Effective rule list in multi-agent sessions
In multi-agent trees, a tool attempt may be governed by rules from ancestors in the session as well as the current agent version. Phrony concatenates those lists (ancestors first, then this version’s rules) into one set used for evaluation.Rule shape
Each rule has:| Field | Meaning |
|---|---|
id | Stable identifier for auditing and UI. |
when | Conditions (below). An empty when matches nothing—a safeguard against accidental “match everything” rules. |
then | One of allow, block, pause, terminate_session. |
reason (optional) | Short text carried into audits and operator-facing views. |
When several rules match
Every matching rule is recorded in the audit trail. The outcome applied to the call uses strict precedence:terminate_session → block → pause → allow
The strictest matching action wins; history still lists all rules that matched.
Conditions (when)
Top-level predicates are combined with AND. Nested all_of, any_of, and not build richer logic.
| Predicate idea | Role |
|---|---|
| Tool identity | Match allowed tool names via a list or a regex. |
| Arguments | Compare, bound, list-membership, regex, or presence checks at JSON paths in the tool payload. |
call_count_in_run_gt | Matches once a tool (optionally scoped to one tool name) has been attempted more than a threshold in the current run. |
call_count_in_session_gt | Same pattern across the entire session, including root and sub-agent runs, using shared session semantics. |
call_count_in_window_gt | Matches when attempts exceed a threshold inside a sliding time window (seconds). |
call_count_in_window_gt: Enforced in async / Guard-side evaluation. The inline checker at attempt time does not apply this predicate by itself. Use it for follow-up detection (incidents, alerts), not a guarantee at every single attempt.
Example rules (illustrative)
These snippets show patterns you can adapt.tool_name_in must list the exact tool names Phrony exposes for your allowed operations—that is usually each operation’s id (often a UUID), not the label you see in the UI. Copy real values from the agent version, a manifest export, or session tooling so when matches live attempts. Argument paths (amount, to, and so on) must match the JSON shape your integration’s tool schema uses.
Rules with then: pause require a HITL or Sub-agent execution mode agent; block and terminate_session work on Request mode too.
Payments — pause transfers above a threshold (HITL)
Pause before the tool runs so someone can approve large movements (adjust the path and currency field to match your connector).amount_cents and a threshold like 1000000 for $10,000.
Email — block sends without a support ticket (Request)
Usearg_missing so the model cannot call send unless it supplies a field your schema defines (here support_ticket_id).
Email — pause when the recipient looks like personal webmail (HITL)
arg_regex matches a string at a JSON path. Tune the path (to, recipients.0, body.to, and so on) and pattern to your tool’s arguments.
\\. (backslash + dot inside the string).
Payments or charges — stop the session after too many attempts
call_count_in_run_gt matches when the attempt count for the scope is strictly greater than value (see the call_count_in_run_gt row in the conditions table). Example: with value: 2 and a tool filter, the rule can match on the third attempt of that tool in the same run, so you can end the session before further payment tries.
tool on call_count_in_run_gt if you want the threshold to apply across all tools in the run (see the conditions table above).
Email or messaging — burst detection (async / Guard)
Flag many sends in a short wall-clock window for incidents or alerts—not a hard inline gate on every single attempt:call_count_in_window_gt is evaluated on the async / Guard path. Pair it with how you want operators to respond (incidents, anomaly_alert tasks, and so on). A rule whose when is only a window predicate does not drive inline checks by itself—use call_count_in_run_gt or argument predicates when you need a hard gate on every attempt.
Execution mode and pause rules
Rules withthen: pause stop before the tool executes and open anomaly_review.
Phrony rejects saving pause rules on agents in Request execution mode. Use HITL on the agent (or configure a Sub-agent appropriately) when you need pause-for-review behavior from L1.
block, allow, and terminate_session remain available on Request-mode agents.
Terminate session
terminate_session ends the session when it wins precedence for a matched attempt. Use it when a pattern must stop all further work in that session, not only block a single call.
Manifest and exports
Version-level anomaly settings appear in a manifest asanomalyControl and optional rules on each version. The JSON rule format is shared across runtime and policy evaluation.