SASY, a new open-source project released under the Apache-2.0 license, introduces a method for enforcing AI agent policies through declarative logic. Instead of relying on large language models to judge safety, SASY checks every action an agent takesβsuch as sending an email or executing a commandβagainst rules written in Datalog. This approach ensures that decisions are deterministic and cannot be manipulated by prompt injections, addressing a critical vulnerability in current agentic workflows.
How SASY Enforces Safety
The system operates by recording the entire history of an agent's interactions, including what documents it reads and which tools it calls. When an agent attempts a new action, the SASY engine analyzes the dependency graph of that action against the user-defined policy. For example, if an agent reads a sensitive report and an untrusted note instructing it to change the recipient, SASY can deny the email send because the action depends on both trusted and untrusted sources. This check happens outside the LLM, meaning the model cannot argue its way past the restriction.
Integration with Coding Agents
SASY includes SASY Guard, a specialized component for coding agents like Claude Code, Codex, and Pi. Guard blocks destructive commands, prevents piping downloaded scripts into shells, and stops data exfiltration after secrets are read. It requires Claude Code version 2.1.289 or later and integrates via a plugin marketplace. The guard traces tool calls back to their source; if an agent tries to send data to an external server after reading a .env file, the command is blocked because the data lineage includes a secret.
Advantages Over LLM Guardrails
Unlike NeMo Guardrails or LlamaFirewall, which often use another LLM to judge safety and can be fooled by well-crafted prompts, SASY uses compiled logic rules. This results in faster, consistent decisions that do not vary based on model temperature or context window limitations. SASY also supports recursive rules, allowing policies to follow chains of dependencies of any length, and includes a policy analyzer that detects conflicts and redundancies in the ruleset before deployment.
Key Takeaways
- SASY uses Datalog, a declarative logic language, to define agent policies, ensuring deterministic enforcement.
- The system tracks data flow across multi-agent handoffs and tool calls, creating a dependency graph rather than a simple log.
- SASY Guard provides specific protections for coding agents, blocking actions like exfiltrating secrets after reading .env files.
- Policies are compiled to native code, allowing for high-performance checks that run before any tool execution.
- The tool contrasts with LLM-based guardrails by eliminating the risk of prompt injection bypassing safety checks.
The Bottom Line
SASY represents a necessary shift from probabilistic, LLM-based safety checks to deterministic, logic-based enforcement. By treating agent history as a queryable graph rather than a passive log, it closes the loop on prompt injection vulnerabilities that current guardrails cannot reliably stop.