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.3.tar.gz (22.6 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.3-py3-none-any.whl (44.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: superagentx_policy_engine-1.0.3.tar.gz
  • Upload date:
  • Size: 22.6 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.3.tar.gz
Algorithm Hash digest
SHA256 0dda98f3f3fa44cccf4cc017a5b06be123d48d1ff8e944df54d32a4fae0c41db
MD5 27cfb51726ac2b865b931a9b29339093
BLAKE2b-256 1bd0c91bc435036e6c43488979601e395f484e5ddec86b1e35db8f7c7fdf1e4b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: superagentx_policy_engine-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 44.2 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9cedefa9f2ae73d7576b23c0f37fa49e6a48fb8e6ea37ed4d4efda193c3a4698
MD5 9a612bd45127baacc1c117898e998ac7
BLAKE2b-256 5dada67d4322350fe18537ae2a3ec2882a863edd2dbfd9609e33ddcfe5cfa31b

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