Skip to main content

SuperAgentX Policy Engine. Enterprise-grade AI Agent Governance Framework. Govern AI agents with policies, approvals, threat detection, cost controls, memory protection, PII, compliance protections and multi-agent security.

Project description

SuperAgentX Policy Engine

AI Governance Framework for Autonomous AI Systems

Python License Async

SuperAgentX Policy Engine is an AI Agent Governance Framework designed to secure, control, and govern autonomous AI systems.

Unlike traditional authorization frameworks, SuperAgentX Policy Engine understands:

  • Agents
  • Workflows
  • LLMs
  • Tools
  • Memory
  • Multi-Agent Systems
  • Human Approvals
  • AI Threats

Why This Exists

Modern AI Agents can:

  • Execute shell commands
  • Access databases
  • Call APIs
  • Modify memory
  • Spawn new agents
  • Communicate with other agents
  • Spend money through LLM usage
  • Access enterprise systems

Traditional authorization systems were built for users and applications.

They were not built for:

Agent -> Agent
Agent -> Tool
Agent -> LLM
Agent -> Memory
Agent -> Workflow
Agent -> Enterprise Systems

SuperAgentX Policy Engine introduces a governance layer between AI agents and execution.


Architecture

Agent
   │
   ▼

Governance Layer

   ├── Threat Detection
   ├── Rate Limiting
   ├── Quota Management
   ├── Policy Evaluation
   ├── Human Approval (HITL)
   ├── Cost Governance
   └── Audit Logging

   │
   ▼

Tool / LLM / Database / API

Features

Policy-Based Governance

IAM-style policies.

Human-in-the-Loop (HITL)

Require approvals before risky actions.

Threat Detection

Detect:

  • Prompt Injection
  • Jailbreak Attempts
  • Data Exfiltration
  • Credential Theft
  • Agent Abuse
  • Recursive Agent Attacks

Cost Governance

Control AI spending.

Tool Governance

Control access to tools.

Memory Governance

Protect sensitive memory.

Agent Governance

Control:

  • agent:execute
  • agent:spawn
  • agent:communicate

Audit Trail

Track every decision.

Async First

Built for high-scale agent systems.


Installation

pip install superagentx-policy-engine

Quick Start

Load Policy

from superagentx_policy_engine.policy_engine import PolicyEngine
from superagentx_policy_engine.store.file_store import FilePolicyStore

engine = PolicyEngine()

policy = FilePolicyStore.load(
    "policies/allow_search.json"
)

await engine.add_policy_document(policy)

Policy Format

{
  "version": "2026-01-01",
  "statements": [
    {
      "sid": "AllowWebSearch",
      "effect": "Allow",
      "action": [
        "tool:execute"
      ],
      "resource": [
        "tool:web_search"
      ]
    }
  ]
}

Effects

Supported effects:

Allow
Deny
Approve

Priority:

Deny
 >
Approve
 >
Allow

Human Approval Example

{
  "sid":"LargeSpendApproval",
  "effect":"Approve",
  "action":["llm:invoke"],
  "resource":["*"],
  "condition":{
    "NumericGreaterThan":{
      "context.custom.estimated_cost":100
    }
  },
  "approval":{
    "role":"finance_manager"
  }
}

Tool Governance

Block dangerous tools.

{
  "sid":"BlockShell",
  "effect":"Deny",
  "action":["tool:execute"],
  "resource":["tool:shell"]
}

Memory Governance

{
  "sid":"ProtectCustomerMemory",
  "effect":"Deny",
  "action":["memory:delete"],
  "resource":["memory:customer-*"]
}

Agent Spawn Protection

{
  "sid":"SpawnProtection",
  "effect":"Deny",
  "condition":{
    "NumericGreaterThan":{
      "context.custom.spawn_count":50
    }
  }
}

Threat Detection

Built-in threat protection.

Signature Detection

Detects known attacks.

Rule Detection

Detects suspicious behavior.

LLM Detection

Powered by LiteLLM.

Supported providers:

  • OpenAI
  • Claude
  • Gemini
  • Bedrock
  • Azure OpenAI
  • Ollama
  • Groq
  • DeepSeek

Multi-Stage Threat Detection

detector = EnsembleThreatDetector(
    detectors=[
        SignatureThreatDetector(),
        RuleThreatDetector(),
        LiteLLMThreatDetector(
            model="gemini/gemini-2.5-pro"
        )
    ]
)

Pipeline:

Request
   │
   ▼

Signature Detector
   │
   ▼

Rule Detector
   │
   ▼

LLM Detector
   │
   ▼

Policy Engine

Policy Hierarchy

Global Policy
      │
      ▼
Workflow Policy
      │
      ▼
Agent Policy
      │
      ▼
Engine Policy
      │
      ▼
Handler Policy

Multi-Agent Governance

Govern agent interactions.

Research Agent
      │
      ▼
Fact Check Agent
      │
      ▼
Summary Agent
      │
      ▼
Report Agent

Policies can control:

agent:execute
agent:spawn
agent:communicate

SuperAgentX Integration

AgentXPipe
     │
     ▼

workflow:start
     │
     ▼

agent:execute
     │
     ▼

engine:execute
     │
     ▼

tool:execute

Governance checks can happen at every stage.


Use Cases

AI Workforce Governance

Control autonomous teams.

FinOps

Control AI spending.

Production Change Management

Require approvals before production access.

Secure Tool Usage

Restrict dangerous operations.

Multi-Agent Security

Govern agent-to-agent interactions.

Memory Protection

Prevent accidental deletion.

Enterprise AI Governance

Apply policies consistently across all agents.


Examples

01_allow
02_deny_override
03_hitl_approval
04_tool_governance
05_cost_governance
06_spawn_protection
07_chain_depth_protection
08_memory_governance
09_threat_detection
10_budget_control
11_prod_database_approval
12_multi_agent_governance
13_showcase_demo
14_llm_threat_detection
15_multi_stage_threat_detection

Roadmap

Current

  • Allow
  • Deny
  • Approve
  • Conditions
  • Threat Detection
  • Rate Limiting
  • Quotas
  • Audit Logs
  • LiteLLM Integration

Upcoming

  • Policy Registry
  • Policy Versioning
  • Policy Signing
  • Workflow Policies
  • Agent Policies
  • Engine Policies
  • Handler Policies
  • ReBAC
  • Cedar Compatibility

Comparison

Feature SuperAgentX OPA Cedar
Agent Governance
HITL Approvals
Threat Detection
LLM Governance
Cost Governance
Multi-Agent Governance

Contributing

Contributions are welcome.

Please open issues, discussions, and pull requests.


License

SuperAgentX Policy Engine is released under the MIT License.


Built for the next generation of autonomous AI systems.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

superagentx_policy_engine-1.0.1.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

superagentx_policy_engine-1.0.1-py3-none-any.whl (38.7 kB view details)

Uploaded Python 3

File details

Details for the file superagentx_policy_engine-1.0.1.tar.gz.

File metadata

  • Download URL: superagentx_policy_engine-1.0.1.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for superagentx_policy_engine-1.0.1.tar.gz
Algorithm Hash digest
SHA256 827a32261f3bff1659f12170ccbcdd47a8dbd1ccd5ae62079e163d4ed2bbdf60
MD5 43bd31d71c56bb0608e51cc2357458c2
BLAKE2b-256 e86f1fec25ff616a2aceea9c8c82ef881e561ab34171f4e7fe656bda33fcf717

See more details on using hashes here.

File details

Details for the file superagentx_policy_engine-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: superagentx_policy_engine-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 38.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for superagentx_policy_engine-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f16cffda8203e38991da9a505ec23f1d72f1e4308772e7d3a5ab0588e615f9eb
MD5 e857606f4832b7eb75bd5c8b7f0ec484
BLAKE2b-256 f76fc26a540032c554a6fe643b14139f49cba787d45c38d79eb672d242530e01

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page