-
Notifications
You must be signed in to change notification settings - Fork 2
fix(tools): pre-execution verifier blocks (FirewallVerifier, DestructiveCommands) not written to audit log #2343
Copy link
Copy link
Closed
Labels
P2High value, medium complexityHigh value, medium complexitybugSomething isn't workingSomething isn't working
Description
Summary
When the FirewallVerifier or other pre-execution verifiers block a tool call, the block event is logged as a WARN trace and increments pre_execution_blocks metrics — but no AuditEntry is written to the audit log (.local/testing/data/audit-test.jsonl stays empty for blocked calls).
Reproduction
- Run agent with
[tools.audit] enabled = true - Ask it to:
Use the read tool to read /etc/passwd - Agent outputs:
[error] Tool call to read was blocked by pre-execution verifier. - Check audit file: empty — no
"type":"blocked"entry
Expected
The audit log should contain an entry like:
{"timestamp":"...","tool":"read","command":"/etc/passwd","result":{"type":"blocked","reason":"[FirewallVerifier] sensitive path pattern '/etc/passwd' matched..."},"duration_ms":0}Root Cause
Pre-execution blocking happens in native.rs (around line 681). At that point:
AuditResult::Blockedis NOT created or written- Only
tracing::warn!andself.update_metrics()are called
The AuditResult::Blocked path exists in ShellExecutor::check_permissions() (shell policy blocklist), but FirewallVerifier blocks in native.rs bypass the shell executor entirely.
Impact
- Security audits are incomplete: all
FirewallVerifierblocks are invisible in the audit trail - SIEM integrations that parse the audit JSONL would miss pre-execution firewall events
- Compliance: the audit log is supposed to be a complete record of all tool call outcomes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2High value, medium complexityHigh value, medium complexitybugSomething isn't workingSomething isn't working