Skip to main content

edon-openclaw · PyPI Python License: MIT

EDON governance for OpenClaw/Clawdbot agents. Every tool call your Telegram bot makes is evaluated by EDON before it executes.

pip install edon-openclaw

Architecture

Telegram User
      ↓
Clawdbot / OpenClaw agent
      ↓
edon-openclaw  ← intercepts tool calls
      ↓
EDON Gateway evaluates the action
      ↓
ALLOW  → tool executes
BLOCK  → blocked, reason logged
HUMAN  → escalated for approval

Quickstart (2 minutes)

pip install edon-openclaw
export EDON_API_KEY=your-key
export EDON_AGENT_ID=clawdbot-agent

@governed_skill decorator

The fastest way to add governance to any Clawdbot skill:

from edon_openclaw import governed_skill
from edon.exceptions import EdonBlockedError

@governed_skill(action_type="email.send")
def send_email(to: str, subject: str, body: str) -> str:
    """Send an email — only runs if EDON allows it."""
    return smtp_send(to, subject, body)

@governed_skill(action_type="web.search")
def search_web(query: str) -> str:
    """Search the web — usually ALLOWED."""
    return brave_search(query)

@governed_skill(action_type="shell.exec")
def run_command(command: str) -> str:
    """Run a shell command — BLOCKED by default policy."""
    ...

# Works with async skills too
@governed_skill(action_type="calendar.write")
async def create_event(title: str, date: str) -> str:
    return await calendar_api.create(title, date)

Three integration patterns

1. @governed_skill — per-function

Best for decorating individual skill functions. One line per skill.

from edon_openclaw import governed_skill

@governed_skill(
    action_type="email.send",
    agent_id="my-bot",                  # optional, defaults to EDON_AGENT_ID
    raise_on_block=True,                # raise EdonBlockedError on BLOCK
)
def send_email(to: str, subject: str, body: str) -> str:
    return smtp_send(to, subject, body)

2. EdonOpenClawGuard — tool registries

Best when Clawdbot dispatches from a dict or list of tools.

from edon_openclaw import EdonOpenClawGuard

# Dict registry
TOOLS = {
    "send_email": send_email,
    "search_web": search_web,
    "create_event": create_event,
}

governed = EdonOpenClawGuard.wrap_tools(
    tools=TOOLS,
    api_key=os.environ["EDON_API_KEY"],
    agent_id="clawdbot-agent",
    raise_on_block=False,  # Return error string to LLM instead of raising
)

# Use exactly like before — governance is transparent
result = governed["send_email"](to="user@example.com", subject="Hi", body="...")

3. EdonClawdProxy — gateway-level

Best for governing at the dispatch layer, not per-function.

from edon_openclaw import EdonClawdProxy

proxy = EdonClawdProxy(
    api_key=os.environ["EDON_API_KEY"],
    agent_id="clawdbot-agent",
)

def dispatch(tool_name: str, **kwargs) -> str:
    tool_fn = TOOLS[tool_name]
    return proxy.execute(
        action_type=f"tool.{tool_name}",
        payload=kwargs,
        fn=tool_fn,
        fn_kwargs=kwargs,
    )

# Check without executing
verdict = proxy.check("tool.send_email", {"to": "user@example.com"})
print(verdict["decision"])  # "ALLOW" or "BLOCK"

Handling blocked actions

from edon.exceptions import EdonBlockedError, EdonEscalatedError

try:
    send_email(to="all@company.com", subject="Blast", body="...")
except EdonBlockedError as e:
    print(f"Blocked: {e.reason}")
    print(f"Code:    {e.reason_code}")    # e.g. "OUT_OF_SCOPE"
    print(f"Audit:   {e.action_id}")      # trace the decision
except EdonEscalatedError as e:
    print(f"Needs human approval: {e.question}")
    # Route e.question to your human-in-the-loop queue

Environment variables

EDON_API_KEY=your-key          # required
EDON_BASE_URL=https://...      # optional: self-hosted gateway URL
EDON_AGENT_ID=clawdbot-agent   # optional: default agent identifier

Self-hosting

Point at your own EDON gateway:

@governed_skill(
    action_type="email.send",
    api_key="your-token",
    base_url="http://localhost:8000",
)
def send_email(...):
    ...

Links


License

MIT © EDON Core

Metadata

Release files for edon-openclaw 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for edon-openclaw 0.1.0
File Size Uploaded
edon_openclaw-0.1.0.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for edon-openclaw 0.1.0
File Interpreter ABI Platform
edon_openclaw-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.3 kB

Release files / edon_openclaw-0.1.0.tar.gz

Download URL edon_openclaw-0.1.0.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bf61075eeb0512111d4135d9702e00a2fc0644b52748723d7ea151c95763c939
BLAKE2b-256 checksum
How to use checksums
183e6b7bcc0123273e6c46ea5375e1e95cf0c04725c2f7e69506ea8540523e92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release files / edon_openclaw-0.1.0-py3-none-any.whl

Download URL edon_openclaw-0.1.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e650322d366b31e30326afd08c469efab16bc9692503d8eab722102136ca7fe
BLAKE2b-256 checksum
How to use checksums
2548dacc18f5405011aac9a744c51780d55d4a4bfaeaf23811cc39908d059630
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page