Skip to main content

Agent Policy Layer - Portable, composable policies for AI agents

Project description

alt text APL restrains your agents - when you need him to! ๐Ÿš”

Portable, composable policies for AI agents.

CI CodeQL codecov PyPI Python versions License: Apache 2.0

Installation โ€ข Quick Start โ€ข How It Works โ€ข Examples โ€ข API Reference


WITHOUT APL ๐Ÿ˜ฐ

alt text more examples here

WITH APL ๐Ÿ›ก๏ธ

alt text more examples here

The Problem

You've built an HR agent for your enterprise. It works great in happy paths - updates employee records, applies for time-offs - great! But then:

  • ๐Ÿ˜ฑ It leaks a customer's SSN in a response
  • ๐Ÿ’ธ It burns through your token budget in one conversation
  • ๐Ÿ—‘๏ธ It deletes production data without asking
  • ๐Ÿšซ It goes off-topic into areas you didn't intend

You need guardrails that can enforce your enterprise's policies.

But existing solutions are:

Problem Why It Hurts
Framework-specific Locked into LangGraph? Can't use that CrewAI policy.
Code-embedded Policies buried in your agent code/prompts. Hard to update.
Boolean only Just allow/deny. Can't modify or escalate.
No composition What happens when 3 policies disagree?

The Solution: APL

APL is a protocol for agent policies โ€” like MCP, but for constraints instead of capabilities.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     Your Agent                              โ”‚
โ”‚                                                             โ”‚
โ”‚   "Delete all files"                                        โ”‚
โ”‚          โ”‚                                                  โ”‚
โ”‚          โ–ผ                                                  โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚   โ”‚              APL Policy Layer                       โ”‚   โ”‚
โ”‚   โ”‚                                                     โ”‚   โ”‚
โ”‚   โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚   โ”‚
โ”‚   โ”‚  โ”‚ PII      โ”‚  โ”‚ Budget   โ”‚  โ”‚ Confirm  โ”‚           โ”‚   โ”‚
โ”‚   โ”‚  โ”‚ Filter   โ”‚  โ”‚ Limiter  โ”‚  โ”‚ Delete   โ”‚           โ”‚   โ”‚
โ”‚   โ”‚  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜           โ”‚   โ”‚
โ”‚   โ”‚       โ”‚             โ”‚             โ”‚                 โ”‚   โ”‚
โ”‚   โ”‚       โ–ผ             โ–ผ             โ–ผ                 โ”‚   โ”‚
โ”‚   โ”‚    ALLOW         ALLOW        ESCALATE              โ”‚   โ”‚
โ”‚   โ”‚                                   โ”‚                 โ”‚   โ”‚
โ”‚   โ”‚              Final: ESCALATE โ—„โ”€โ”€โ”€โ”€โ”˜                 โ”‚   โ”‚
โ”‚   โ”‚              "Confirm delete?"                      โ”‚   โ”‚
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚          โ”‚                                                  โ”‚
โ”‚          โ–ผ                                                  โ”‚
โ”‚   ๐Ÿ›ก๏ธ Action blocked until user confirms                      
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key features:

Feature Description
๐Ÿ”Œ Runtime-agnostic Works with OpenAI, Anthropic, LangGraph, LangChain, or custom agents
๐ŸŽฏ Rich verdicts Not just allow/deny โ€” also modify, escalate, observe
๐Ÿ“ Declarative policies Write policies in YAML, no Python required
๐Ÿ”ฅ Hot-swappable Update policies without redeploying your agent
โšก Auto-instrumentation One line to protect all your LLM calls

๐Ÿ“ฆ Installation

pip install agent-policy-layer

That's it. No Docker, no external services.


๐Ÿš€ Quick Start (2 minutes)

Option A: Auto-Instrumentation (Easiest)

One line protects all your OpenAI/Anthropic calls automatically:

import apl

# This patches OpenAI, Anthropic, LiteLLM, and LangChain
apl.auto_instrument(
    policy_servers=["stdio://./my_policy.py"]
)

# Now use your LLM normally โ€” APL intercepts automatically
from openai import OpenAI
client = OpenAI()

response = client.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": "What's my SSN? It's 123-45-6789"}]
)

# If your policy redacts PII, the response is already clean!
print(response.choices[0].message.content)
# โ†’ "Your SSN is [REDACTED]"

Option B: Create a Policy Server

Step 1: Create my_policy.py:

from apl import PolicyServer, Verdict
import re

server = PolicyServer("my-policies")

@server.policy(
    name="redact-ssn",
    events=["output.pre_send"],
)
async def redact_ssn(event):
    text = event.payload.output_text or ""
    
    if re.search(r'\d{3}-\d{2}-\d{4}', text):
        redacted = re.sub(r'\d{3}-\d{2}-\d{4}', '[REDACTED]', text)
        return Verdict.modify(
            target="output",
            operation="replace",
            value=redacted,
            reasoning="SSN detected and redacted"
        )
    
    return Verdict.allow()

if __name__ == "__main__":
    server.run()

Step 2: Run it:

apl serve my_policy.py --http 8080

Step 3: Test it:

curl -X POST http://localhost:8080/evaluate \
  -H "Content-Type: application/json" \
  -d '{
    "type": "output.pre_send",
    "payload": {"output_text": "Your SSN is 123-45-6789"}
  }'
{
  "composed_verdict": {
    "decision": "modify",
    "modification": {
      "target": "output",
      "value": "Your SSN is [REDACTED]"
    }
  }
}

๐Ÿ”„ How It Works

The Data Flow

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                                                                             โ”‚
โ”‚  1. USER INPUT          2. AGENT PROCESSES        3. AGENT RESPONDS         โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€          โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€        โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€          โ”‚
โ”‚                                                                             โ”‚
โ”‚  "What's my SSN?"  โ”€โ”€โ–บ  Agent calls LLM    โ”€โ”€โ–บ  "Your SSN is 123-45-6789"   โ”‚
โ”‚                              โ”‚                          โ”‚                   โ”‚
โ”‚                              โ”‚                          โ”‚                   โ”‚
โ”‚                              โ–ผ                          โ–ผ                   โ”‚
โ”‚                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚
โ”‚                    โ”‚ APL HOOK:       โ”‚        โ”‚ APL HOOK:       โ”‚           โ”‚
โ”‚                    โ”‚ llm.pre_request โ”‚        โ”‚ output.pre_send โ”‚           โ”‚
โ”‚                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ”‚
โ”‚                             โ”‚                          โ”‚                    โ”‚
โ”‚                             โ”‚                          โ”‚                    โ”‚
โ”‚                             โ–ผ                          โ–ผ                    โ”‚
โ”‚                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”‚
โ”‚                    โ”‚           POLICY SERVERS                    โ”‚          โ”‚
โ”‚                    โ”‚                                             โ”‚          โ”‚
โ”‚                    โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ”‚          โ”‚
โ”‚                    โ”‚  โ”‚ Budget  โ”‚ โ”‚   PII   โ”‚ โ”‚ Topic   โ”‚        โ”‚          โ”‚
โ”‚                    โ”‚  โ”‚ Check   โ”‚ โ”‚ Filter  โ”‚ โ”‚ Guard   โ”‚        โ”‚          โ”‚
โ”‚                    โ”‚  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜        โ”‚          โ”‚
โ”‚                    โ”‚       โ”‚           โ”‚           โ”‚             โ”‚          โ”‚
โ”‚                    โ”‚       โ–ผ           โ–ผ           โ–ผ             โ”‚          โ”‚
โ”‚                    โ”‚    ALLOW       MODIFY      ALLOW            โ”‚          โ”‚
โ”‚                    โ”‚                  โ”‚                          โ”‚          โ”‚
โ”‚                    โ”‚                  โ–ผ                          โ”‚          โ”‚
โ”‚                    โ”‚    Composed: MODIFY (redact SSN)            โ”‚          โ”‚
โ”‚                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ”‚
โ”‚                                       โ”‚                                     โ”‚
โ”‚                                       โ–ผ                                     โ”‚
โ”‚                          "Your SSN is [REDACTED]"                           โ”‚
โ”‚                                                                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Event Types

APL intercepts at key moments in the agent lifecycle:

Event When Use Cases
input.received User message arrives Injection detection, input validation
llm.pre_request Before calling LLM Budget checks, prompt modification
llm.post_response After LLM responds Hallucination detection
tool.pre_invoke Before tool execution Permission checks, arg validation
tool.post_invoke After tool returns Result validation
output.pre_send Before sending to user PII redaction, content filtering

Verdict Types

Policies don't just allow or deny โ€” they can guide:

# โœ… Allow the action
Verdict.allow()

# โŒ Block the action
Verdict.deny(reasoning="Contains prohibited content")

# ๐Ÿ”„ Modify and continue
Verdict.modify(
    target="output",
    operation="replace",
    value="[REDACTED]",
    reasoning="PII detected"
)

# โš ๏ธ Require human approval
Verdict.escalate(
    type="human_confirm",
    prompt="Delete production database?",
    options=["Proceed", "Cancel"]
)

# ๐Ÿ‘๏ธ Just observe (for audit logging)
Verdict.observe(
    reasoning="Logged for compliance",
    trace={"action": "sensitive_query"}
)

๐Ÿ“ Examples

1. PII Filter (Redaction)

from apl import PolicyServer, Verdict
import re

server = PolicyServer("pii-filter")

PATTERNS = {
    "ssn": r'\b\d{3}-\d{2}-\d{4}\b',
    "credit_card": r'\b\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}\b',
    "email": r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b',
}

@server.policy(name="redact-pii", events=["output.pre_send"])
async def redact_pii(event):
    text = event.payload.output_text or ""
    
    for name, pattern in PATTERNS.items():
        text = re.sub(pattern, f'[{name.upper()} REDACTED]', text)
    
    if text != event.payload.output_text:
        return Verdict.modify(target="output", operation="replace", value=text)
    
    return Verdict.allow()

2. Budget Limiter

from apl import PolicyServer, Verdict

server = PolicyServer("budget")

@server.policy(name="token-budget", events=["llm.pre_request"])
async def check_budget(event):
    used = event.metadata.token_count
    budget = event.metadata.token_budget or 100_000
    
    if used >= budget:
        return Verdict.deny(reasoning=f"Token budget exceeded: {used:,}/{budget:,}")
    
    if used >= budget * 0.8:
        return Verdict.observe(reasoning=f"Token usage at {used/budget:.0%}")
    
    return Verdict.allow()

3. Destructive Action Confirmation

from apl import PolicyServer, Verdict

server = PolicyServer("safety")

@server.policy(name="confirm-delete", events=["tool.pre_invoke"])
async def confirm_delete(event):
    tool = event.payload.tool_name or ""
    
    if "delete" in tool.lower() or "drop" in tool.lower():
        return Verdict.escalate(
            type="human_confirm",
            prompt=f"โš ๏ธ Destructive action: {tool}\n\nProceed?",
            options=["Proceed", "Cancel"]
        )
    
    return Verdict.allow()

4. Declarative YAML Policy (No Python!)

# compliance.yaml
name: corporate-compliance
version: 1.0.0

policies:
  - name: block-competitor-info
    events:
      - output.pre_send
    rules:
      - when:
          payload.output_text:
            contains: "competitor revenue"
        then:
          decision: deny
          reasoning: "Cannot share competitor financial information"

  - name: confirm-data-export
    events:
      - tool.pre_invoke
    rules:
      - when:
          payload.tool_name:
            matches: ".*export.*"
          metadata.user_region:
            in: [EU, EEA, UK]
        then:
          decision: escalate
          escalation:
            type: human_confirm
            prompt: "๐Ÿ‡ช๐Ÿ‡บ GDPR: Confirm data export for EU user?"
apl serve compliance.yaml --http 8080

๐Ÿงฉ Integration Patterns

Pattern 1: Auto-Instrumentation (Recommended)

import apl

# Patches OpenAI, Anthropic, LiteLLM, LangChain automatically
apl.auto_instrument(
    policy_servers=[
        "stdio://./policies/pii_filter.py",
        "http://compliance.internal:8080",
    ],
    user_id="user-123",
)

# All LLM calls are now protected
from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(...)  # โ† APL intercepts this

Pattern 2: Manual Integration

from apl import PolicyLayer, EventPayload, SessionMetadata

policies = PolicyLayer()
policies.add_server("stdio://./my_policy.py")

# Call this before sending output
verdict = await policies.evaluate(
    event_type="output.pre_send",
    payload=EventPayload(output_text=response_text),
    metadata=SessionMetadata(session_id="...", user_id="...")
)

if verdict.decision == "modify":
    response_text = verdict.modification.value

Pattern 3: LangGraph Wrapper

from langgraph.graph import StateGraph
from apl.adapters.langgraph import APLGraphWrapper

# Build your graph
graph = StateGraph(MyState)
graph.add_node("agent", agent_node)
graph.add_node("tools", tool_node)

# Wrap it with APL
wrapper = APLGraphWrapper()
wrapper.add_server("stdio://./my_policy.py")
wrapped_graph = wrapper.wrap(graph)

# Use wrapped_graph โ€” policies evaluated automatically

๐Ÿ“– API Reference

CLI Commands

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Command     Description                                     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  serve       Run a policy server                             โ”‚
โ”‚  test        Test a policy with sample events                โ”‚
โ”‚  validate    Validate a policy file                          โ”‚
โ”‚  init        Create a new policy project                     โ”‚
โ”‚  info        Show system information                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
# Run a policy server with HTTP
apl serve ./policy.py --http 8080

# Test a policy
apl test ./policy.py -e output.pre_send

# Create a new project
apl init my-policy --template pii

# Validate without running
apl validate ./policy.yaml

HTTP API

Endpoint Method Description
/evaluate POST Evaluate policies for an event
/health GET Health check
/metrics GET Prometheus metrics
/manifest GET Server manifest

Python API

from apl import (
    # Core
    PolicyServer,      # Create policy servers
    PolicyLayer,       # Connect to policy servers
    Verdict,           # Policy responses
    
    # Auto-instrumentation
    auto_instrument,   # Patch LLM clients
    uninstrument,      # Remove patches
    
    # Types
    EventType,         # Lifecycle events
    EventPayload,      # Event-specific data
    SessionMetadata,   # Session context
    Message,           # Chat message format
)

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         YOUR APPLICATION                            โ”‚
โ”‚                                                                     โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚   โ”‚                    APL Policy Layer                           โ”‚ โ”‚
โ”‚   โ”‚                                                               โ”‚ โ”‚
โ”‚   โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”‚ โ”‚
โ”‚   โ”‚  โ”‚   Client    โ”‚   โ”‚   Client    โ”‚   โ”‚   Client    โ”‚          โ”‚ โ”‚
โ”‚   โ”‚  โ”‚  (stdio)    โ”‚   โ”‚   (HTTP)    โ”‚   โ”‚  (WebSocket)โ”‚          โ”‚ โ”‚
โ”‚   โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ”‚ โ”‚
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
              โ”‚                 โ”‚                 โ”‚
              โ–ผ                 โ–ผ                 โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Policy Server  โ”‚   โ”‚  Policy Server  โ”‚   โ”‚  Policy Server  โ”‚
โ”‚  (Local Python) โ”‚   โ”‚  (Remote HTTP)  โ”‚   โ”‚  (YAML)         โ”‚
โ”‚                 โ”‚   โ”‚                 โ”‚   โ”‚                 โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚   โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚   โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ Policy 1  โ”‚  โ”‚   โ”‚  โ”‚ Policy A  โ”‚  โ”‚   โ”‚  โ”‚ Rule 1    โ”‚  โ”‚
โ”‚  โ”‚ Policy 2  โ”‚  โ”‚   โ”‚  โ”‚ Policy B  โ”‚  โ”‚   โ”‚  โ”‚ Rule 2    โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚   โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚   โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ›ก๏ธ

Secure your agents. Sleep better at night.

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

agent_policy_layer-0.4.0.tar.gz (4.0 MB view details)

Uploaded Source

Built Distribution

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

agent_policy_layer-0.4.0-py3-none-any.whl (118.9 kB view details)

Uploaded Python 3

File details

Details for the file agent_policy_layer-0.4.0.tar.gz.

File metadata

  • Download URL: agent_policy_layer-0.4.0.tar.gz
  • Upload date:
  • Size: 4.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for agent_policy_layer-0.4.0.tar.gz
Algorithm Hash digest
SHA256 5b1f52a5d81238362ada113da1b68ba6b8391dabd2fa818bcec4b5a9761d22bf
MD5 164edf7a31185800dce656f3aceee80c
BLAKE2b-256 f77080a79e18a75c3fa034d631b8862a369a6020d28cea2d7bd8778be9d0f8bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_policy_layer-0.4.0.tar.gz:

Publisher: release-please.yml on nimonkaranurag/agentpolicylayer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agent_policy_layer-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_policy_layer-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74450876fff850a4ada06f0b44f34e8b85f7162ec110dfe0365a58aa21732197
MD5 b720c6fe48e1b790300e79996a091847
BLAKE2b-256 13c3bd2ffb335ea14ba4511f9c28eb3c69f79681a3984d43d3ed0116997c3078

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_policy_layer-0.4.0-py3-none-any.whl:

Publisher: release-please.yml on nimonkaranurag/agentpolicylayer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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