OpenGuardrails (OGR) reference runtime — a vendor-neutral enforcement protocol for AI agent safety & security: GuardEvent to Verdict, composed under a policy you own.
Project description
openguardrails
The OpenGuardrails (OGR) reference runtime — a vendor-neutral enforcement
protocol for AI agent safety & security. Each agent action becomes a GuardEvent,
runs past whatever detectors you choose, and gets back a Verdict that can allow,
block, or require approval before the action runs. Security/safety vendors plug
in behind a single Detector interface, and deployers compose them with one policy.
pip install openguardrails
Zero dependencies (stdlib only).
The contract in 30 seconds
from openguardrails import Runtime, GuardEvent
from openguardrails.detectors.config_rules import ConfigRulesDetector
from openguardrails.detectors.llm_judge import LLMJudgeDetector
rt = Runtime(
detectors=[ConfigRulesDetector(policy["config_rules"]), LLMJudgeDetector()],
policy=policy, # composition + rules, deployer-owned
)
verdict = rt.evaluate(GuardEvent(...)) # -> allow | block | require_approval | redact | modify
GuardEvent— a normalized observation of an agent action (a tool call, an exec, model I/O) plus its provenance (trust labels on the inputs that produced it). The same wire type at every altitude.Detector— the competitive surface. A detector is OGR-conformant if it maps aGuardEventto aVerdict. Rules, a classifier, or a hosted model — your choice.provideris its stable identity for attribution and benchmarking.Runtime— the PDP: fans out to detectors, composes their verdicts (deny-wins / quorum / first-available), propagates provenance, and correlates altitudes byguard_idso a later observation point can only tighten an earlier decision.
Write a detector (the whole vendor surface)
from openguardrails.detectors import Detector
from openguardrails import Verdict, Category
class AcmeInjectionDetector(Detector):
provider = "acme.injection"
handles = ("tool_call", "exec", "model_output")
def evaluate(self, ev):
... # rules, classifier, or hosted model
return Verdict(ev.event_id, ev.guard_id, self.provider, "block",
categories=[Category("security.prompt_injection", "security", 0.97)])
Instrument an agent
This is the SDK. To guard a real agent, install a per-target instrumentation package:
openguardrails-instrumentation-hermes— secures a Hermes agent across the gateway, tool-call hook, and sandbox exec.
Status
v0.1 — reference implementation validating the
specification. The wire
contract is the product; this runtime is the proof it runs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openguardrails-0.1.2.tar.gz.
File metadata
- Download URL: openguardrails-0.1.2.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ba6acb9be20862c3378d2b50d912e8c569210577ea1191e3defcbce96668753
|
|
| MD5 |
9808eae05afddaefa4b3e636ef012c42
|
|
| BLAKE2b-256 |
e699f7f2ef2ffdf2c7ae7675329daa713ef6ad39ce4179e2c04495fc9a39c456
|
Provenance
The following attestation bundles were made for openguardrails-0.1.2.tar.gz:
Publisher:
publish.yml on openguardrails/openguardrails-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openguardrails-0.1.2.tar.gz -
Subject digest:
4ba6acb9be20862c3378d2b50d912e8c569210577ea1191e3defcbce96668753 - Sigstore transparency entry: 2117187787
- Sigstore integration time:
-
Permalink:
openguardrails/openguardrails-python@9cb9a39bfd4e87d0e7672eb5ecb011212aa9ad02 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/openguardrails
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9cb9a39bfd4e87d0e7672eb5ecb011212aa9ad02 -
Trigger Event:
release
-
Statement type:
File details
Details for the file openguardrails-0.1.2-py3-none-any.whl.
File metadata
- Download URL: openguardrails-0.1.2-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3722f86241cf8b3ffc3c01f1685fc7b5d30d341c5b4c04a43a73ea2841777d6
|
|
| MD5 |
13b395b5409c4a7b65bc0053dfaa5110
|
|
| BLAKE2b-256 |
070cc5011ef8d5e5d018fbba70e4322292a6ab5255f009af5651effe21cde18f
|
Provenance
The following attestation bundles were made for openguardrails-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on openguardrails/openguardrails-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openguardrails-0.1.2-py3-none-any.whl -
Subject digest:
b3722f86241cf8b3ffc3c01f1685fc7b5d30d341c5b4c04a43a73ea2841777d6 - Sigstore transparency entry: 2117187883
- Sigstore integration time:
-
Permalink:
openguardrails/openguardrails-python@9cb9a39bfd4e87d0e7672eb5ecb011212aa9ad02 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/openguardrails
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9cb9a39bfd4e87d0e7672eb5ecb011212aa9ad02 -
Trigger Event:
release
-
Statement type: