action_guard
Apply the Brain OS policy table to a risk assessment to determine if an action should be allowed, require confirmation, or be blocked.
Instructions
Apply the Brain OS policy table to a risk assessment. Takes the output of risk_assess plus the concrete action type and returns a policy decision: allow (proceed), ask (stop and get explicit user confirmation), or block (do not proceed). Pure TypeScript — no LLM call. Policies in order: private_to_public → block; critical risk → block; force-push → ask; npm publish → ask; security boundary → ask; irreversible → ask; high risk → ask; hard-to-reverse external → ask; medium + requires_confirmation → ask; else → allow. Always audit what was decided and why.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entity_id | No | Brain OS entity this action is associated with. | |
| assessment | Yes | The full output of risk_assess. | |
| action_type | Yes | The concrete action being guarded, e.g. 'npm publish', 'git push origin main', 'force push', 'write ROADMAP.md'. |