Block and alert levels
Set the guardrail block_at and alert_at levels: where to set them, which scope wins, what the rule pack supplies by default, and how to change them.
Two settings decide how severe a finding must be before the guardrail acts:
block_atis the lowest severity that is blocked.alert_atis the lowest severity that raises an alert.
Both take CRITICAL, HIGH, MEDIUM or LOW. They are the only levels for rule and judge findings, on every guardrail surface: hook tool calls, prompts and tool results, and proxy prompts, completions and tool calls. Later steps of the cascade can still change the final action (Cascade and Rego). To change them, go to Set the levels.
What the two levels do
With block_at: HIGH and alert_at: MEDIUM:
| Finding severity | Action mode | Observe mode |
|---|---|---|
CRITICAL, HIGH | Blocked | Alert |
MEDIUM | Alert | Alert |
LOW | Allowed | Allowed |
- Anything that blocks also alerts. An
alert_ataboveblock_atalerts from the block level instead;config get guardrail.alert_at --effectivelabels it(clamped to block_at). - Observe mode does not enforce policy findings. Findings at the alert level or above are logged as alerts; fail mode and proxy availability can still stop a call. One rule is the exception (Set up and modes).
- Human approval sits below the block level. With human approval on, a finding at or above
guardrail.hilt.min_severitybut belowblock_atasks, where the agent can ask. - Only eligible findings block. A regex match on a tool call is detection only, and an alert-only rule (such as
impact.sql_destructive_mutation,attack.http_command_injection,attack.http_sql_injectionorexec.postgresql_copy_program) stays an alert at everyblock_at.
Which severities block, alert or ask
block_at is the lowest severity that blocks, alert_at the lowest that alerts. Human approval asks below the block level.
Effective values
- guardrail.block_at
- HIGH(source: config:guardrail.block_at)
- guardrail.alert_at
- MEDIUM(source: pack-default:default)
- guardrail.hilt
- enabled: false
Action modeCRITICAL blocks, HIGH blocks, MEDIUM alerts, LOW is allowed.
Text version of this figure
default pack, block_at HIGH, alert_at MEDIUM, human approval off, a finding that can block.
| Finding severity | Action mode | Observe mode |
|---|---|---|
| CRITICAL | Blocked | Alert |
| HIGH | Blocked | Alert |
| MEDIUM | Alert | Alert |
| LOW | Allowed | Allowed |
Scopes and precedence
A level can be set at four scopes. The most specific scope that sets a value wins; an unset scope falls through to the next.
- Profile connector:
guardrail.profiles.<profile>.connectors.<connector>.block_at - Profile:
guardrail.profiles.<profile>.block_at - Connector:
guardrail.connectors.<connector>.block_at - Global:
guardrail.block_at - Rule-pack default: the posture of the pack that scope uses (below)
block_at and alert_at resolve independently. Other guardrail settings also take an application-protection overlay between the connector and the global scope (User and group profiles), but that overlay cannot carry block_at or alert_at: a config that sets either under application_protection is refused.
A profile's level outranks guardrail.connectors.<connector>: a user a profile selects gets the profile's block_at even on a connector with its own, unless the profile sets that connector too.
guardrail:
block_at: HIGH # global: HIGH and CRITICAL block everywhere
alert_at: MEDIUM
connectors:
codex:
block_at: CRITICAL # connector: Codex blocks only CRITICAL
profiles:
contractors:
block_at: MEDIUM # profile: contractors block MEDIUM and above
alert_at: LOW
connectors:
codex:
block_at: HIGH # profile connector: except on CodexWhich scope sets the level
The most specific scope that sets a level wins, for block_at and alert_at separately. A profile outranks the connector unless it sets that connector too.
A person in the contractors profile on Codexblock_at HIGH, from guardrail.profiles.contractors.connectors.codex; alert_at LOW, from guardrail.profiles.contractors.
config.yaml above, with the default rule pack. An unset scope falls through to the next. config get --effective reads the global and connector scopes; for a profile, run defenseclaw guardrail profile explain.Text version of this figure
A person in the contractors profile on Codex. The scope that sets each level is marked.
| Scope | block_at | alert_at |
|---|---|---|
| 1. Profile connector (guardrail.profiles.contractors.connectors.codex) | HIGH (sets it) | not set |
| 2. Profile (guardrail.profiles.contractors) | MEDIUM | LOW (sets it) |
| 3. Connector (guardrail.connectors.codex) | CRITICAL | not set |
| 4. Global (guardrail) | HIGH | MEDIUM |
| 5. Rule-pack default (pack-default:default) | CRITICAL | MEDIUM |
Rule-pack default (posture)
A scope with no level of its own takes the default of the rule pack it enforces:
| Posture | block_at | alert_at | Pick it when |
|---|---|---|---|
default | CRITICAL | MEDIUM | You want to stop obvious harm. With human approval on, eligible HIGH findings ask first. |
strict | MEDIUM | LOW | A missed attack costs more than an interruption. Turn the LLM judge on too. |
permissive | CRITICAL | HIGH | You are piloting, or agents must stay available. |
The posture of a pack is, in order:
- the
posturefield ofdefenseclaw-pack.jsonat the pack's root, if the file exists; - the
tierof the pack'stiers.yaml, if it has one; - the pack's own name, for the shipped packs;
strictfor a copy kept in a folder namedstrict;defaultfor every other folder. A folder namedpermissiveisdefault.
A custom pack is default unless it says otherwise, even when copied from strict into a folder with another name. To keep strict levels for a copy, add a manifest:
{"posture": "strict"}The manifest is part of the pack digest, so adding or editing it needs a new pin (Packs and rules). Because scopes can select different packs, the default can differ per scope; setting block_at explicitly removes that dependency.
Read the effective value
config get --effective prints the value the gateway enforces and, on stderr, where it comes from:
$ defenseclaw config get guardrail.block_at --effective
(source: config:guardrail.block_at)
HIGH
$ defenseclaw config get guardrail.connectors.codex.block_at --effective
(source: config:guardrail.connectors.codex.block_at)
CRITICALThe source is config:<key> for a value you set, or pack-default:<posture> when the rule pack decides. --effective reads the global and connector scopes. For a profile, ask which profile a request resolves to:
defenseclaw guardrail profile explain --connector codex --user aliceprofile explain with an unknown connector exits with an error: the gateway returns HTTP 400 with unknown connector and the valid connectors. There is no fallback to the global levels.
defenseclaw guardrail status shows each connector's levels in its Block/alert column (MEDIUM+/LOW+). On a managed host, where the Python CLI is not installed, defenseclaw-gateway policy show prints what the gateway compiled from config.yaml.
Set the levels
| To | Run |
|---|---|
| Set the global block level | defenseclaw guardrail block-at HIGH |
| Set the global alert level | defenseclaw guardrail alert-at MEDIUM |
| Set one connector's level | defenseclaw guardrail block-at CRITICAL --connector codex |
| Clear a level so it inherits | defenseclaw guardrail block-at inherit --connector codex |
| Set a profile's level | defenseclaw config set guardrail.profiles.contractors.block_at MEDIUM |
| Set a profile connector's level | defenseclaw config set guardrail.profiles.contractors.connectors.codex.block_at HIGH |
| Remove a profile key | defenseclaw config unset guardrail.profiles.contractors.block_at |
| Take an admission preset's levels | defenseclaw policy activate strict |
block-atandalert-attakeCRITICAL,HIGH,MEDIUM,LOW(any case) orinherit, and have no--profileoption.- Every change is validated before it is written; a bad level is refused and
config.yamlstays as it was. policy activatewritesguardrail.block_atandalert_atonly where the preset's level differs from the selected rule pack's default (Presets and packs).- The running gateway applies the change on its next decision; the command ends with
The running gateway applies it now.
Check it worked: defenseclaw config get guardrail.block_at --effective. Undo: defenseclaw guardrail block-at inherit --connector codex, or config unset for a profile key.
Managed devices refuse local changes
On a device managed by MDM or a management plane, the config writer refuses with This device is managed: change config.yaml in the admin config (MDM or management plane), not on the device. Set the levels in the admin config instead.
When a change does not apply
Levels, rule packs, guardrail.rules, profiles, the mode, human approval and the trust level reload without a restart.
- If a change is invalid, the previous policy keeps running.
/healthshowspolicy.last_reload_erroranddefenseclaw doctorfails its Policy row. - The
guardrailcommands wait up to 10 seconds for the gateway to report the new config generation. If it does not, they say so and namedefenseclaw-gateway restart;mode,block-atandalert-atthen exit 1. - These keys need a restart:
guardrail.host,port,enabled,connector,scanner_mode,retain_judge_bodies,protected_filesand the hook self-heal settings. The writer printsRestart the gateway to apply <key>. Withgateway.config_reload.mode: restartthe gateway restarts itself.
Cisco AI Defense trust level
guardrail.cisco_trust_level sets how much a Cisco AI Defense verdict counts with scanner_mode: remote or both. It is global only.
| Value | Effect |
|---|---|
full (default) | Counts like a local finding and can reach block_at. |
advisory | A Cisco verdict that alone would block raises an alert instead, unless a local finding also reaches the alert level. The permissive preset sets this. |
none | Cisco AI Defense severities are ignored. |
Set it with defenseclaw config set guardrail.cisco_trust_level advisory.
Packs and rules
Choose a guardrail rule pack, add your own pinned by digest, validate it, and change single rules, suppressions and sensitive tools with guardrail.rules.
Presets and packs
See what a fresh DefenseClaw install ships: three admission presets and three rule packs named permissive, default and strict, and how to inspect them.