Approval Detector

Some actions are not provably malicious but cannot be undone or reach outside the machine. A blocklist cannot list them all, and blocking them breaks legitimate work, so kiteguard returns a Confirm verdict and the host asks a human.

Runs after all block detectors, on shell commands only (src/detectors/approval.rs), using the structural shell parser, so echo ok && npm publish and sudo npm publish are seen.

RuleExamples
approval_publishnpm/cargo/poetry publish, twine upload, gem push, docker push, gh release create
approval_deploykubectl apply/patch/scale, helm upgrade, terraform apply, pulumi up, vercel --prod, gh pr merge, aws ... update-service
approval_sendmail, sendmail, aws sns publish, aws ses send-email, Twilio
approval_paymentStripe create/refund/transfer/payout
approval_api_writecurl -X POST/PUT/PATCH/DELETE or a body flag to a non-local host, gh api -X ...
approval_db_writepsql/mysql/sqlite3/mongo writes, redis-cli SET/DEL/...
approval_remotessh host 'sudo ...'

--dry-run, --check, --simulate, --what-if and requests to localhost are not gated.

How the host is told

HostEventSignal
Claude Code, CopilotPreToolUsestdout permissionDecision: "ask", exit 0
CursorpreToolUse, beforeShellExecution, beforeMCPExecution{"permission":"ask",...}, exit 0
Gemini, other events, unknown hostsanydegrades to a block

By default (block_instead_of_ask: true) these actions are blocked. A host that cannot prompt always gets a block, never a silent allow.