Install
openclaw skills install guardrailsfor-agentBuild, run, and extend the Agent Policy & Guardrails Engine. Use when implementing policy formats, enforcement logic, decision conflict resolution, policy APIs, and audit/compliance workflows.
openclaw skills install guardrailsfor-agentALLOW, DENY, MODIFY, REQUIRE_APPROVAL).app/main.py: FastAPI endpoints.app/service.py: orchestration for policy CRUD + evaluation + audit writes.app/engine.py: core policy evaluation and conflict resolution.app/policy_parser.py: JSON/YAML/NL policy parsing into structured definitions.app/schemas.py: request/response and policy schemas.app/models.py: SQLAlchemy models (policies, audit_logs).app/seed.py: baseline policies.tests/test_api.py: API-level behavior.tests/test_engine.py: decision logic behavior.Install and test:
python3 -m pip install -r requirements.txt
python3 -m pytest
Run locally:
python3 -m uvicorn app.main:app --reload
All external agent/tool actions must be sent to POST /evaluate before execution.
Runtime handling expectations:
DENY: block execution.REQUIRE_APPROVAL: pause and require explicit human approval.MODIFY: apply returned modifications, then execute.ALLOW: execute.When multiple policies match the same action:
priority wins.DENY > REQUIRE_APPROVAL > MODIFY > ALLOW.app/seed.py (optional baseline).action_types and conditions map to real runtime payload fields.tests/test_api.py using /evaluate.tests/test_engine.py for edge/conflict cases.