Sondera Harness¶
Deterministic guardrails for AI agents.
Open-source. Works with LangGraph, ADK, Strands, or any custom agent.
What is Sondera Harness?¶
Sondera Harness evaluates Cedar policies before your agent's actions execute. When a policy denies an action, the agent gets a reason why and can try a different approach. Same input, same verdict. Deterministic, not probabilistic.
Example policy:
@id("forbid-risky-fs-shell")
forbid(
principal,
action == Action::"Bash",
resource
)
when {
context has parameters &&
(context.parameters.command like "*rm -rf /*" ||
context.parameters.command like "*mkfs*" ||
context.parameters.command like "*dd if=/dev/zero*" ||
context.parameters.command like "*> /dev/sda*")
};
This policy stops your agent from running rm -rf, every time.
Why Use Sondera Harness?¶
- Steer, don't block. Denied actions include a reason. Return it to the model, and it tries something else.
- Deterministic. Stop debugging prompts. Rules are predictable.
- Drop-in integration. Native middleware for LangGraph, Google ADK, and Strands.
- Full observability. Every action, every decision, every reason. Audit-ready.
See Everything in Real-Time¶
The TUI shows trajectories, adjudications, and policy decisions as your agent runs.
Platform only
The TUI requires Sondera Platform (SonderaRemoteHarness). The local CedarPolicyHarness doesn't persist trajectory data.
Installation¶
Python 3.12+ required.
With framework extras:
Add Sondera Harness to Your Agent¶
from langchain.agents import create_agent
from sondera import CedarPolicyHarness
from sondera.langgraph import SonderaHarnessMiddleware, Strategy
harness = CedarPolicyHarness(policy_set=policy, schema=schema)
middleware = SonderaHarnessMiddleware(harness=harness, strategy=Strategy.STEER)
agent = create_agent(model, tools=tools, middleware=[middleware])
Local or Platform¶
CedarPolicyHarness evaluates policies locally with no network calls or external dependencies. Good for development and simple deployments.
SonderaRemoteHarness connects to Sondera Platform for team policy management, dashboards, and centralized audit logs.
Both implement the same interface. Switch by changing one line.
Need Help?¶
- Join Slack for questions and feedback
- Open an issue to report bugs