agent-policy-guardrails-engine

Build, run, and extend the Agent Policy & Guardrails Engine. Use when implementing policy formats, enforcement logic, decision conflict resolution, policy APIs, and audit/compliance workflows.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "agent-policy-guardrails-engine" with this command: npx skills add adad44/guardrailsfor-agent

Agent Policy & Guardrails Engine

Use This Skill When

  • You need to add or change policy enforcement behavior.
  • You need to add policy types (financial, privacy, communication, operational, approval, time-based).
  • You need to extend decision outputs (ALLOW, DENY, MODIFY, REQUIRE_APPROVAL).
  • You need to update APIs, persistence, or audit logging.

Project Layout

  • 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.

Standard Workflow

  1. Implement schema/model changes first if policy structure changes.
  2. Update parser and engine evaluation paths.
  3. Update API/service layer only as needed.
  4. Add or update tests for both engine and API.
  5. Run tests before finalizing.

Commands

Install and test:

python3 -m pip install -r requirements.txt
python3 -m pytest

Run locally:

python3 -m uvicorn app.main:app --reload

Enforcement Contract

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.

Conflict Resolution Rules

When multiple policies match the same action:

  1. Highest priority wins.
  2. If tied on priority, effect severity wins: DENY > REQUIRE_APPROVAL > MODIFY > ALLOW.

Adding New Guardrails

  1. Add a structured policy in app/seed.py (optional baseline).
  2. Ensure action_types and conditions map to real runtime payload fields.
  3. Add API test coverage in tests/test_api.py using /evaluate.
  4. Add engine-level tests in tests/test_engine.py for edge/conflict cases.

Notes

  • Keep policy evaluation deterministic.
  • Prefer structured JSON/YAML policies for complex controls.
  • Natural-language rules should compile into the same structured policy schema.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

V19 Trust Manifesto

Agent Community认知治理协议公开受信声明v1.2.93。核心协议工程化完成(V94联通/DLP状态机知识图谱钩子/治理锚点INITIAL_TRUST_ANCHOR=4.0/72h未交互Agent自动标记/kpc_feedback_deposit跨模块接口打通)。任务市场完整生命周期(发布→认领→提交...

Registry SourceRecently Updated
Automation

Databricks Labs

Databricks is a unified data and AI platform from Apache Spark founders, integrating data engineering, analytics, and machine learning workflows on a Lakehou...

Registry SourceRecently Updated
Automation

Find Agent

OceanBus-powered agent and service discovery via Yellow Pages. Use when users want to find someone, look for a service, reach out to an expert, discover anot...

Registry SourceRecently Updated
Automation

Appdynamics

AppDynamics is Cisco's APM platform offering full-stack application, infrastructure, and user experience monitoring with integrated AIOps for enterprise obse...

Registry SourceRecently Updated