Jev Policy Engine
Python policy-as-code SDK that runs Noul, Choice and Score rules defined in YAML through Jev, with audit mode and fail-closed options.
Overview
Jev Policy Engine is a policy-as-code SDK for Jev. Teams define governance rules as Noul, Choice and Score questions in YAML, tag them (for example cpq or security), and run only relevant rules against an input. Rules support an audit (shadow) enforcement mode and an on_failure: fail_closed setting. Rules are loaded through a YAML provider designed to be extended to sources like Notion, CSV or Salesforce custom metadata.
The README describes four uses: gating agent tool calls such as run_command or execute_sql and returning a block so the agent self-corrects; routing tasks by a complexity score to expensive or cheap agents; enforcing rules in CI by piping a diff or plan into the CLI; and validating form payloads in backend middleware with a 403 on violation. It works with the TypeSafe SDK and with Vercel AI Gateway.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Yes / no | Does this proposed command or payload violate the policy?(inferred) | yes · no |
| Score | How complex is this request (1-10)? | — |
| Choice | Which category does this input fall under for the policy?(inferred) | — |
How it works
- Write rules in YAML with tags and enforcement mode
- Pass an input (tool args, diff, form payload) to the engine
- Jev answers the tagged rules
- Return pass, block or audit-only results; fail closed on errors if configured
Strengths
- Non-developers can manage rules in YAML
- Audit mode for shadow testing
- Usable in agents, CI and backends
Caveats
- Semantic rules are probabilistic despite 'deterministic' framing
- Requires the TypeSafe SDK and key
- Early project
Getting started
git clone https://github.com/bhavinm/jev-policy-engine.git && cd jev-policy-engine && pip install -e . && pip install typesafe-sdk pyyamlAt a glance
- Type
- Library
- Status
- prototype
- Language
- Python
- Runtime
- Library and CLI
- Has code
- yes
Use cases and integrations
How curated lists describe it
Policy conformance: universal Policy-as-Code SDK that allows DevOps and security teams to enforce deterministic AI governance rules in YAML via Jev with audit mode and fail-closed controls.
yibie/awesome-jev
Frequently asked questions
How are rules defined?
As Noul, Choice and Score questions in YAML, with tags and enforcement settings.
Can I test rules without blocking?
Yes. enforcement_mode: audit runs rules in shadow mode.
Can it run in CI?
Yes. Pipe a diff or plan into jev-policy evaluate with a rules file.
Related projects
Auditable Zig terminal agent pairing Codex for coding with Jev typed preflight and postflight checks under deterministic policy gates.
CLIproductionZigGateway that checks agent tool calls with policy plus Jev evidence, then binds approval to a single-use permit for that exact action.
MCP serverbetaTypeScriptMCP proxy and hooks that screen agent tool calls before they run and their results before the agent reads them, using Jev judgments.
MCP serverbetaTypeScriptXano backend template where Jev judges each agent tool call as safe, needs review or dangerous, and uncertain calls wait for a human.
ProjectbetaXanoScriptOpenAI-compatible endpoint that answers an agent's command-approval call with APPROVE, DENY or ESCALATE from a Jev Choice, failing closed.
ProxybetaPythonClaude Code plugin adding Jev judgments to Bash, Write and Edit calls and their outputs; a semantic guardrail, not a sandbox.
Pluginbeta