Summary
Create an Ouroboros-native plugin/adaptation layer for guardrails-ai/guardrails that preserves the Guardrails user experience while translating Guardrails capabilities into the Ouroboros plugin contract: explicit commands, declared capabilities, scoped permissions, audit/provenance events, durable state, and handoff artifacts.
The goal is not to reduce Guardrails to a thin shell wrapper. The goal is to make Guardrails feel like Guardrails inside Ouroboros while letting Ouroboros act as a true agentOS: a substrate that can run external capability systems smoothly, safely, audibly, and resumably.
Related context: #27 defines the plugin layer as the capability assimilation layer for external tools, OSS libraries, and domain workflows.
Product Goal
A user who already understands Guardrails should be able to bring the same mental model into Ouroboros:
- define or reference a Guardrails guard/spec/config;
- install or use Guardrails validators where appropriate;
- validate LLM inputs, outputs, or generated artifacts;
- inspect familiar Guardrails-style validation outcomes;
- optionally use Guardrails server-style flows;
- receive normalized Ouroboros evidence, audit, provenance, state, and handoff artifacts without losing the original Guardrails workflow feel.
In short:
Guardrails experience
+ Ouroboros plugin contract
+ Seed / Ledger / State / Provenance / Permission / Audit / Handoff
= Guardrails as an Ouroboros-native agentOS capability
Why This Belongs in ouroboros-plugins
Guardrails is a strong reference candidate for the open-source library assimilation model described in #27:
- It is an external OSS capability system, not an Ouroboros core primitive.
- It has a clear domain: LLM input/output validation, risk detection, structured-output enforcement, and validator composition.
- It has multiple execution surfaces: Python SDK, CLI, Hub validators, and optional server mode.
- It requires careful boundary management around file reads/writes, network access, dependency installation, model downloads, and possible remote inference.
- It can produce high-value downstream evidence for
ooo auto, Seed validation, artifact review, eval loops, and agent run acceptance gates.
This should prove a reusable pattern for future validation/evaluation adapters such as Semgrep, CodeQL, pytest, Hypothesis, mutation testing, OpenAPI validators, and other external harnesses.
Core Thesis
Do not implement this as:
ooo guardrails raw -- <anything>
Implement it as:
Guardrails guard/spec/config
+ bounded artifact/input/output target
+ declared plugin command
+ declared permissions
+ Guardrails ValidationOutcome
+ normalized Ouroboros report
+ audit/provenance/state updates
+ handoff artifact
The plugin should preserve Guardrails semantics while making every invocation legible to Ouroboros.
Guardrails Capabilities to Assimilate
Primary Capability: Validation Harness
Assimilate Guardrails as an LLM validation harness:
- validate known LLM output;
- validate generated artifact content;
- validate input/output text using configured validators;
- produce pass/fail/blocking evidence;
- expose validator summaries and remediation information;
- generate a handoff artifact for downstream Ouroboros workflows.
This should be the MVP.
Secondary Capability: Structured Output Contract Checking
Guardrails supports structured-output generation/validation using Pydantic/RAIL-style specs. The plugin should eventually support using Guardrails as an artifact contract checker for generated JSON, structured reports, and Seed-derived outputs.
Tertiary Capability: Hub/Validator Lifecycle
Guardrails Hub validators are powerful but require stricter permission boundaries. Hub installation should be optional and separated from read-only validation commands.
Tertiary Capability: Server Mode
Guardrails server mode may be valuable for long-running agentOS integrations, but it should be treated as a later lifecycle/runtime feature, not the MVP.
UX Principle: Preserve Guardrails Experience
The plugin should not force users to abandon Guardrails idioms. It should support familiar concepts and names where possible:
- Guard
- validator
- RAIL/spec/config
- validate / parse
- ValidationOutcome
- validation summaries
- Hub validator URI
- local model vs remote inference choices, if/when supported
However, every familiar Guardrails operation must be projected into the Ouroboros contract.
Example desired UX:
# Validate a known LLM output with a Guardrails spec and emit an Ouroboros report.
ooo guardrails validate-output \
--spec ./guards/toxic-language.rail \
--output ./.omx/artifacts/model-output.txt \
--report ./.omx/reports/guardrails-toxic-language.json
# Validate an Ouroboros artifact and attach the result as a handoff/evidence bundle.
ooo guardrails validate-artifact \
--spec ./guards/structured-report.py \
--artifact ./.omx/artifacts/research-summary.md \
--handoff ./.omx/handoffs/guardrails-research-summary.json
The report should still make it easy to recognize the Guardrails outcome, but Ouroboros should also be able to consume it.
Proposed Plugin Name and Namespace
Candidate plugin names:
guardrails-eval
llm-guardrails
guardrails-ai
Recommended MVP:
Plugin name: guardrails-eval
Command namespace: guardrails
Rationale: the plugin is an evaluation/validation adapter, not a full replacement for Guardrails Hub or server management.
Proposed Command Surface
MVP Commands
ooo guardrails validate-output
Validate a known LLM output string/file against a Guardrails spec/config.
Inputs:
--spec <path>: repo-relative Guardrails RAIL/spec/config path;
--output <path> or --text <string>: target output to validate;
--metadata <path> optional runtime metadata JSON;
--report <path> optional output report path;
--handoff <path> optional handoff artifact path.
Expected outputs:
- normalized JSON report;
- human-readable summary;
- plugin audit events;
- provenance references to bounded inputs;
- handoff artifact that downstream Ouroboros workflows can consume.
Risk: write if report/handoff is emitted; read_only only if dry-run/no-write is supported.
ooo guardrails validate-artifact
Validate an Ouroboros artifact path against a Guardrails spec/config.
Inputs:
--artifact <path>;
--spec <path>;
--report <path>;
--handoff <path>.
Expected use:
- post-generation checks;
ooo auto acceptance gates;
- Seed output validation;
- research/eval artifact verification.
Risk: write.
ooo guardrails summarize-report
Read a Guardrails/Ouroboros validation report and produce a concise human summary.
Risk: read_only or write if persisted.
Later Commands
ooo guardrails install-validator
Install a Guardrails Hub validator.
This must be a separate, explicitly trusted command because it may involve network access, dependency installation, filesystem writes, and local model downloads.
Potential scopes:
network:read
filesystem:write
shell:execute
Risk: write; may require confirmation.
ooo guardrails create-config
Wrap Guardrails config creation while bounding output paths and recording provenance.
Risk: write.
ooo guardrails start-server
Run Guardrails server mode under Ouroboros runtime supervision.
This is not MVP. It likely needs a stronger lifecycle/process contract.
Risk: write or stronger depending on network/process exposure.
Manifest Direction
The MVP should fit the current 0.1 manifest schema without speculative schema expansion.
Illustrative direction, not necessarily final:
{
"schema_version": "0.1",
"name": "guardrails-eval",
"version": "0.1.0",
"description": "Assimilate Guardrails AI validation into Ouroboros audit and handoff artifacts.",
"source": {
"type": "local_path",
"path": "plugins/guardrails-eval",
"repository": "https://github.com/Q00/ouroboros-plugins"
},
"commands": [
{
"namespace": "guardrails",
"name": "validate-output",
"summary": "Validate an LLM output against a Guardrails spec and emit an Ouroboros handoff report.",
"usage": "ooo guardrails validate-output --spec <path> --output <path> --report <path>",
"risk": "write",
"requires_confirmation": false,
"arguments": [
{
"name": "spec",
"type": "path",
"required": true,
"description": "Repo-relative Guardrails RAIL/config/spec path."
},
{
"name": "output",
"type": "path",
"required": true,
"description": "Repo-relative LLM output artifact to validate."
},
{
"name": "report",
"type": "path",
"required": false,
"description": "Repo-relative path for validation report JSON."
}
]
}
],
"capabilities": [
{
"name": "ledger",
"access": "write",
"reason": "Record validation pass/fail evidence."
},
{
"name": "provenance",
"access": "write",
"reason": "Record bounded guard spec and artifact references."
},
{
"name": "handoff",
"access": "attach",
"reason": "Attach validation reports for downstream Ouroboros runs."
},
{
"name": "state",
"access": "write",
"reason": "Persist validation session status and report paths."
}
],
"permissions": [
{
"scope": "filesystem:read",
"risk": "read_only",
"required": true,
"reason": "Read guard specs and target output artifacts."
},
{
"scope": "filesystem:write",
"risk": "write",
"required": false,
"reason": "Write validation reports and handoff artifacts."
}
],
"entrypoint": {
"type": "command",
"command": "python -m guardrails_eval"
}
}
Report / Handoff Contract
The plugin should emit a normalized report that preserves Guardrails-native fields while adding Ouroboros metadata.
Suggested report shape:
{
"schema_version": "0.1",
"tool": {
"name": "guardrails-ai",
"source_repository": "https://github.com/guardrails-ai/guardrails",
"package": "guardrails-ai"
},
"plugin": {
"name": "guardrails-eval",
"version": "0.1.0"
},
"input": {
"spec_path": "./guards/example.rail",
"target_path": "./.omx/artifacts/output.txt",
"metadata_path": null
},
"guardrails_outcome": {
"validation_passed": true,
"validated_output": {},
"validation_summaries": [],
"error": null
},
"ouroboros_result": {
"status": "success",
"risk": "write",
"permissions_used": ["filesystem:read", "filesystem:write"],
"capabilities_used": ["ledger:write", "provenance:write", "handoff:attach"]
},
"handoff": {
"consumer_hint": "Use this report as validation evidence for the associated artifact.",
"artifact_status": "accepted"
}
}
The handoff should be stable enough for future ooo auto, workflow IR, run/step/artifact projections, or agentOS gates to consume.
Permission and Risk Model
MVP permissions
Required:
filesystem:read — read Guardrails specs/configs and target artifacts.
Optional:
filesystem:write — write reports and handoff artifacts.
Later permissions
Optional and command-specific:
network:read — fetch Guardrails Hub metadata or remote inference metadata;
network:write — only if invoking remote inference or external APIs that mutate/session-log;
shell:execute — run Guardrails CLI or install commands;
filesystem:write — install validators, write configs, cache models;
runtime:execute capability — supervise server mode or long-running validation processes, if supported by contract.
Important risk split
Local validation and Hub installation must not share the same trust path.
A user should be able to trust local validation without trusting dependency installation or server launch.
Boundary Rules
- Default to repo-relative paths.
- Do not persist raw secrets, raw API keys, or unbounded prompts in provenance.
- Do not enable Hub installation by default.
- Do not start long-running servers in the MVP.
- Do not expose arbitrary passthrough execution.
- Do not mutate production systems.
- Do not treat Guardrails Hub as an Ouroboros plugin marketplace.
- Do not add domain-specific Guardrails branches to
ooo auto; consume handoff artifacts instead.
Dependency Strategy
Open question for implementation planning:
- Should
guardrails-ai be a plugin dependency installed in the plugin environment?
- Should the plugin call an existing
guardrails CLI if present?
- Should the plugin vendor no Guardrails code and require explicit environment setup?
Recommended starting point:
- implement as an out-of-process Python plugin package;
- depend on
guardrails-ai in plugin packaging or dev requirements;
- keep Hub validator installation outside the MVP;
- provide a clean error if
guardrails-ai is missing.
Implementation Plan
Phase 0 — Contract spike
Phase 1 — MVP plugin skeleton
Phase 2 — Ouroboros-native evidence
Phase 3 — Tests and contract validation
Phase 4 — Optional Hub support
Phase 5 — Optional server/runtime support
Acceptance Criteria
Non-goals
- Do not turn
ouroboros-plugins into a Guardrails Hub mirror or marketplace.
- Do not auto-install arbitrary validators without explicit trust and permission boundaries.
- Do not add unbounded command passthrough.
- Do not start long-running servers in the MVP.
- Do not store raw secrets or unbounded user/model payloads in provenance.
- Do not move Guardrails logic into Ouroboros core.
Open Questions
- Should the MVP support RAIL only, Python config only, or both?
- What should the exact exit-code semantics be for validation failure vs plugin/runtime failure?
- Where should reports be written by default:
.omx/reports/, .ouroboros/, or caller-provided path only?
- Should
filesystem:write be required for the baseline command, or should the plugin support a pure stdout read-only mode?
- How should Guardrails runtime metadata be bounded and redacted?
- Should Guardrails Hub validator installation live in this plugin or a separate plugin/lifecycle command?
- What minimum handoff shape should
ooo auto or future Workflow IR consume?
References
Summary
Create an Ouroboros-native plugin/adaptation layer for
guardrails-ai/guardrailsthat preserves the Guardrails user experience while translating Guardrails capabilities into the Ouroboros plugin contract: explicit commands, declared capabilities, scoped permissions, audit/provenance events, durable state, and handoff artifacts.The goal is not to reduce Guardrails to a thin shell wrapper. The goal is to make Guardrails feel like Guardrails inside Ouroboros while letting Ouroboros act as a true agentOS: a substrate that can run external capability systems smoothly, safely, audibly, and resumably.
Related context: #27 defines the plugin layer as the capability assimilation layer for external tools, OSS libraries, and domain workflows.
Product Goal
A user who already understands Guardrails should be able to bring the same mental model into Ouroboros:
In short:
Why This Belongs in
ouroboros-pluginsGuardrails is a strong reference candidate for the open-source library assimilation model described in #27:
ooo auto, Seed validation, artifact review, eval loops, and agent run acceptance gates.This should prove a reusable pattern for future validation/evaluation adapters such as Semgrep, CodeQL, pytest, Hypothesis, mutation testing, OpenAPI validators, and other external harnesses.
Core Thesis
Do not implement this as:
Implement it as:
The plugin should preserve Guardrails semantics while making every invocation legible to Ouroboros.
Guardrails Capabilities to Assimilate
Primary Capability: Validation Harness
Assimilate Guardrails as an LLM validation harness:
This should be the MVP.
Secondary Capability: Structured Output Contract Checking
Guardrails supports structured-output generation/validation using Pydantic/RAIL-style specs. The plugin should eventually support using Guardrails as an artifact contract checker for generated JSON, structured reports, and Seed-derived outputs.
Tertiary Capability: Hub/Validator Lifecycle
Guardrails Hub validators are powerful but require stricter permission boundaries. Hub installation should be optional and separated from read-only validation commands.
Tertiary Capability: Server Mode
Guardrails server mode may be valuable for long-running agentOS integrations, but it should be treated as a later lifecycle/runtime feature, not the MVP.
UX Principle: Preserve Guardrails Experience
The plugin should not force users to abandon Guardrails idioms. It should support familiar concepts and names where possible:
However, every familiar Guardrails operation must be projected into the Ouroboros contract.
Example desired UX:
The report should still make it easy to recognize the Guardrails outcome, but Ouroboros should also be able to consume it.
Proposed Plugin Name and Namespace
Candidate plugin names:
guardrails-evalllm-guardrailsguardrails-aiRecommended MVP:
Rationale: the plugin is an evaluation/validation adapter, not a full replacement for Guardrails Hub or server management.
Proposed Command Surface
MVP Commands
ooo guardrails validate-outputValidate a known LLM output string/file against a Guardrails spec/config.
Inputs:
--spec <path>: repo-relative Guardrails RAIL/spec/config path;--output <path>or--text <string>: target output to validate;--metadata <path>optional runtime metadata JSON;--report <path>optional output report path;--handoff <path>optional handoff artifact path.Expected outputs:
Risk:
writeif report/handoff is emitted;read_onlyonly if dry-run/no-write is supported.ooo guardrails validate-artifactValidate an Ouroboros artifact path against a Guardrails spec/config.
Inputs:
--artifact <path>;--spec <path>;--report <path>;--handoff <path>.Expected use:
ooo autoacceptance gates;Risk:
write.ooo guardrails summarize-reportRead a Guardrails/Ouroboros validation report and produce a concise human summary.
Risk:
read_onlyorwriteif persisted.Later Commands
ooo guardrails install-validatorInstall a Guardrails Hub validator.
This must be a separate, explicitly trusted command because it may involve network access, dependency installation, filesystem writes, and local model downloads.
Potential scopes:
network:readfilesystem:writeshell:executeRisk:
write; may require confirmation.ooo guardrails create-configWrap Guardrails config creation while bounding output paths and recording provenance.
Risk:
write.ooo guardrails start-serverRun Guardrails server mode under Ouroboros runtime supervision.
This is not MVP. It likely needs a stronger lifecycle/process contract.
Risk:
writeor stronger depending on network/process exposure.Manifest Direction
The MVP should fit the current
0.1manifest schema without speculative schema expansion.Illustrative direction, not necessarily final:
{ "schema_version": "0.1", "name": "guardrails-eval", "version": "0.1.0", "description": "Assimilate Guardrails AI validation into Ouroboros audit and handoff artifacts.", "source": { "type": "local_path", "path": "plugins/guardrails-eval", "repository": "https://github.com/Q00/ouroboros-plugins" }, "commands": [ { "namespace": "guardrails", "name": "validate-output", "summary": "Validate an LLM output against a Guardrails spec and emit an Ouroboros handoff report.", "usage": "ooo guardrails validate-output --spec <path> --output <path> --report <path>", "risk": "write", "requires_confirmation": false, "arguments": [ { "name": "spec", "type": "path", "required": true, "description": "Repo-relative Guardrails RAIL/config/spec path." }, { "name": "output", "type": "path", "required": true, "description": "Repo-relative LLM output artifact to validate." }, { "name": "report", "type": "path", "required": false, "description": "Repo-relative path for validation report JSON." } ] } ], "capabilities": [ { "name": "ledger", "access": "write", "reason": "Record validation pass/fail evidence." }, { "name": "provenance", "access": "write", "reason": "Record bounded guard spec and artifact references." }, { "name": "handoff", "access": "attach", "reason": "Attach validation reports for downstream Ouroboros runs." }, { "name": "state", "access": "write", "reason": "Persist validation session status and report paths." } ], "permissions": [ { "scope": "filesystem:read", "risk": "read_only", "required": true, "reason": "Read guard specs and target output artifacts." }, { "scope": "filesystem:write", "risk": "write", "required": false, "reason": "Write validation reports and handoff artifacts." } ], "entrypoint": { "type": "command", "command": "python -m guardrails_eval" } }Report / Handoff Contract
The plugin should emit a normalized report that preserves Guardrails-native fields while adding Ouroboros metadata.
Suggested report shape:
{ "schema_version": "0.1", "tool": { "name": "guardrails-ai", "source_repository": "https://github.com/guardrails-ai/guardrails", "package": "guardrails-ai" }, "plugin": { "name": "guardrails-eval", "version": "0.1.0" }, "input": { "spec_path": "./guards/example.rail", "target_path": "./.omx/artifacts/output.txt", "metadata_path": null }, "guardrails_outcome": { "validation_passed": true, "validated_output": {}, "validation_summaries": [], "error": null }, "ouroboros_result": { "status": "success", "risk": "write", "permissions_used": ["filesystem:read", "filesystem:write"], "capabilities_used": ["ledger:write", "provenance:write", "handoff:attach"] }, "handoff": { "consumer_hint": "Use this report as validation evidence for the associated artifact.", "artifact_status": "accepted" } }The handoff should be stable enough for future
ooo auto, workflow IR, run/step/artifact projections, or agentOS gates to consume.Permission and Risk Model
MVP permissions
Required:
filesystem:read— read Guardrails specs/configs and target artifacts.Optional:
filesystem:write— write reports and handoff artifacts.Later permissions
Optional and command-specific:
network:read— fetch Guardrails Hub metadata or remote inference metadata;network:write— only if invoking remote inference or external APIs that mutate/session-log;shell:execute— run Guardrails CLI or install commands;filesystem:write— install validators, write configs, cache models;runtime:executecapability — supervise server mode or long-running validation processes, if supported by contract.Important risk split
Local validation and Hub installation must not share the same trust path.
A user should be able to trust local validation without trusting dependency installation or server launch.
Boundary Rules
ooo auto; consume handoff artifacts instead.Dependency Strategy
Open question for implementation planning:
guardrails-aibe a plugin dependency installed in the plugin environment?guardrailsCLI if present?Recommended starting point:
guardrails-aiin plugin packaging or dev requirements;guardrails-aiis missing.Implementation Plan
Phase 0 — Contract spike
Phase 1 — MVP plugin skeleton
plugins/guardrails-eval/ouroboros.plugin.json.plugins/guardrails-eval/guardrails_eval/.validate-output.Phase 2 — Ouroboros-native evidence
Phase 3 — Tests and contract validation
python3 scripts/validate_contract.py.Phase 4 — Optional Hub support
install-validatorcommand only after MVP is stable.Phase 5 — Optional server/runtime support
Acceptance Criteria
ooo autocoherent by consuming handoffs instead of embedding Guardrails-specific branching in core.Non-goals
ouroboros-pluginsinto a Guardrails Hub mirror or marketplace.Open Questions
.omx/reports/,.ouroboros/, or caller-provided path only?filesystem:writebe required for the baseline command, or should the plugin support a pure stdout read-only mode?ooo autoor future Workflow IR consume?References