SASY: Agent Policies in Declarative Logic
SASY launched an Apache-2.0 declarative logic engine that compiles Datalog rules into native code to check every AI agent tool call against session history.
By Dillip Chowdary • Nov 16, 2026 • Source: sasy.ai

At a glance
- Product
- SASY and SASY Guard
- License
- Apache-2.0 open source
- Language
- Datalog declarative logic
- Runtime requirement
- Python 3.11 with uv and Docker
- Minimum Claude Code
- Version 2.1.289 or later
- Framework support
- LangChain, Google ADK, Langroid, Pi, Codex
In this post
SASY released an open-source security engine under the Apache-2.0 license that checks every action an AI agent takes before execution occurs. The platform relies on Datalog declarative logic rules to evaluate whether an action is authorized based on complete session history, according to sasy.ai's report. The software intercepts tool calls such as sending emails or executing shell commands, preventing actions that combine sensitive records with untrusted data inputs.
This report examines how SASY verifies agent execution paths, how SASY Guard secures local coding assistants, and how the underlying logic engine detects rule conflicts. The release serves software engineers, security architects, and developers integrating autonomous agents across LangChain, Google ADK, Langroid, or bespoke Python runtime loops.
01Declarative Datalog policies and dependency tracking
SASY evaluates every pending tool call against declarative logic rules written in Datalog. Rather than keeping a simple event log, the engine constructs a full dependency graph that traces what an agent reads, computes, and produces. This lineage tracks information across summaries, document rewrites, and multi-agent handoffs back to the original source.
When an agent receives instructions to summarize a sensitive report and email reviewer@example.net, the system permits the dispatch. If an untrusted external note instructs the agent to forward the summary to an external address instead, the dependency tracker identifies that the output relies on both sensitive and untrusted inputs. The engine rejects the action and supplies the agent with the rule reason.
Note: SASY compiles Datalog rules directly into native code, enabling pre-execution policy checks without slowing down active tool invocations.
02Integration across frameworks and local runtimes
Developers can integrate SASY into agent architectures automatically or through targeted software hooks. The SASY SDK integrates out of the box with LangChain, Google ADK, and Langroid frameworks. Custom agent architectures connect to the engine by inserting sasy.record to log inputs and sasy.check_tool_call before invoking external APIs or shell tools.
Setup requires Python 3.11 alongside uv and Docker installations. Developers can provision the engine manually in a terminal using four concrete steps:
- Virtual environment uv venv --python 3.11
- Environment activation source .venv/bin/activate
- Package addition uv add sasy
- Daemon startup sasy engine start
Teams using coding assistants can alternatively run npx skills add sasy-labs/sasy to automate local installation. Policies can also be drafted from plain text using the write-policy skill, while sasy-why-blocked explains blocked execution paths.
03Runtime protection for developer coding agents
Advertisement
Tech Pulse Daily
Get tomorrow's pulse first
Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.
The project includes SASY Guard, an extension that enforces action policies directly on local developer workstations. Guard monitors coding agents to block dangerous operations such as running destructive shell commands, piping downloaded web scripts into a shell, or exfiltrating local environment secrets. If a prompt injection triggers an agent to read a local .env secret file and transmit data to a remote server, Guard blocks the outbound request.
Setup for coding agents can be initiated globally through npx skills add -g sasy-labs/sasy-guard. Manual installation requires running uv tool install sasy-guard and executing sasy-guard install across supported platforms:
- Claude Code mod claude plugin marketplace add sasy-labs/sasy-guard followed by claude plugin install sasy-guard-mod for Claude Code v2.1.289 or later
- Pi extension pi install git:github.com/sasy-labs/sasy-guard
- Codex hook sasy-guard enable --codex followed by trusting the hook prompt inside Codex
The runtime intercepts tool invocations before execution, giving interactive coding agents immediate feedback when a policy halts an action.
04Pre-deployment policy validation and conflict analysis
SASY includes static analysis tools that evaluate an entire rule suite before deployment to prevent unintended access blocks. When developers introduce new security rules, the analyzer checks for contradictions, unintended coverage drops, and redundant logic.
In one test case, adding a rule to restrict all summaries of sensitive documents conflicted with an earlier baseline rule authorizing reviewer emails. The analyzer flagged the issue immediately:
| Analysis finding | Rule target | Detection detail |
|---|---|---|
| Conflict | Rule 3 | Denies sends allowed by Rule 1 without an explicit exception mark |
| Redundant | Rule 2 | Rule 3 already blocks every action that Rule 2 intended to block |
The analyzer verifies which environmental conditions trigger each rule, and policies can include an @ask tag to pause execution and solicit human approval before running sensitive tasks.
05Deterministic logic compared with guardrail alternatives
SASY handles enforcement outside the primary model loop using deterministic code compilation rather than relying on an secondary LLM judge. Standard safety guardrails frequently query a separate model to detect policy violations, leaving systems vulnerable to adversarial bypasses and prompt injections that persuade the evaluation model.
| Architecture feature | SASY | Invariant | NeMo Guardrails | LlamaFirewall | Guardrails AI |
|---|---|---|---|---|---|
| Decides without an LLM judge | Yes | Sometimes ML | Often an LLM | Often an LLM | Often an LLM |
| Tracks how data flows between tool calls | Yes | Order only | No | No | No |
| Tracks multi-agent handoffs | Yes | No | No | No | No |
| Checks the policy for conflicts | Yes | No | No | No | No |
By compiling policies into native code, the platform produces deterministic evaluations where identical histories generate identical access decisions across every tool call.
Frequently asked questions
What is SASY?
SASY is an open-source security engine that evaluates AI agent tool calls against declarative Datalog rules before execution.
How does SASY stop prompt injection attacks?
It tracks data lineage in a dependency graph and evaluates actions outside the model using compiled native code, preventing injections from bypassing policy rules.
Which developer tools and agent frameworks work with SASY Guard?
SASY Guard protects local coding agents including Claude Code v2.1.289 or later, Pi, and Codex, while the SDK supports LangChain, Google ADK, and Langroid.
Sources
Author
Dillip Chowdary
Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.
Related on Tech Bytes
Advertisement