Skip to main content
reopt Handbook
reopt Handbook
LLMOps and AgentOps in Production

Architecture and Release

Ch1. System ArchitectureCh2. Versioning and ReleaseCh3. Evaluation Framework

Operational Reliability

Ch4. Online GuardrailsCh5. Observability and SLOsCh6. Cost and Latency Optimization

Growth and Response

Ch7. Experiment OperationsCh8. Incident Management Runbook

Verification

Verification ReportVerification ArchiveUpdates
Handbook›LLMOps and AgentOps›Ch4. Online Guardrails
한국어English

Ch4. Online Guardrails

Design real-time policy enforcement, blocking, fallback, and human approval loops

Key takeaways

  • Treat online guardrails as control systems that limit business risk, layered as input, intent, tool, and output guards plus escalation.
  • Design quality, cost, and safety fallbacks, and never fail open: degrade to restricted mode and require idempotency keys for high-risk tools.
  • Use resumable human approval: pause the run, persist state and arguments, then resume the same run state after approval to keep one audit trail.
  • Pick guard implementations by latency budget, from regex (<1ms) to LLM-based intent guards (200-500ms), and optimize with parallel execution, caching, early exit, and streaming filters.
  • Extend guardrails to the MCP and Skill supply chain using OWASP MCP Top 10 and Agentic Skills Top 10 controls like allowlists, token audience validation, and code signing.

Online guardrails are not a supplement to model quality. They are control systems that limit business risk.

Guardrail Layers

LayerBlocksAction
Input guardBanned terms or attack patternsReject or ask for a new input
Intent guardDisallowed intentRestricted response
Tool guardHigh-risk actionApproval wait
Output guardPII or secret exposureAutomatic masking

Fallback Design

  • If a high-capability model fails, switch to a conservative prompt and a stable model.
  • If quality regression is detected, roll back to the previous version.

Gate Failure Handling

  • Do not fail open. Policy failure must not permit unlimited execution.
  • Degrade to restricted mode when guardrails fail.
  • Require idempotency keys for high-risk actions.

Human Review and Resumable Approval

Even when the model decides that a high-risk tool call is needed, do not execute it immediately. Pause the run, store the reason and arguments, then resume the same run state after approval or rejection.

StageEvidence to Store
Approval requesttool name, arguments, risk score, requester, trace_id
Pending reviewserialized state, approval_id, SLA, reviewer group
Approval/rejectionreviewer, decision, edited arguments, reason
Resumptionresumed trace_id, final tool result, downstream action

If review may take more than a few minutes, persist state. Do not restart from a new user turn. That preserves the same audit trail and idempotency key.

Approval Queue SLA Example

approval_queue:
  refund_over_limit:
    reviewer_group: finance-ops
    sla_minutes: 15
    auto_expire_minutes: 60
    default_on_expiry: reject
    evidence:
      - trace_id
      - approval_id
      - tool_arguments
      - risk_score
  code_execution:
    reviewer_group: platform-security
    sla_minutes: 5
    auto_expire_minutes: 20
    default_on_expiry: reject

Implementation Complexity

Options by Layer

GuardrailImplementationComplexityLatency Impact
Input GuardRegex-basedLow< 1ms
Input GuardML classifierMedium10-30ms
Intent GuardLLM-basedHigh200-500ms
Tool GuardStatic rulesLow< 1ms
Tool GuardDynamic risk scoreMedium5-10ms
Output GuardPII regexLow< 5ms
Output GuardNER modelMedium20-50ms

Latency Optimization

  • Parallel execution: run independent guards concurrently.
  • Caching: reuse repeated pattern results.
  • Early exit: skip downstream guards when an input guard blocks the request.
  • Streaming filter: filter responses while generation is in progress.

Escalation Patterns

  • Synchronous approval: higher security, higher latency; use for financial transactions.
  • Asynchronous approval: lower latency, medium security; use for bulk processing.
  • Conditional auto-approval: minimum latency; use when risk scoring is reliable.

MCP and Skill Supply-Chain Guardrails

In AgentOps, the attack surface often expands through runtime extensions, not just the model. Use OWASP MCP Top 10 and Agentic Skills Top 10 controls as defaults.

RiskDefault Control
Shadow MCP serverManage server allowlist, owner, purpose, and scope in a registry
Tool poisoningDo not trust tool output; validate provenance and content type
Token mismanagementValidate audience, prohibit token passthrough, use short-lived tokens
Skill compromiseRequire verified publisher, code signing, version pinning, permission manifest
Unexpected code executionUse containers/sandboxes, limit filesystem/network egress, store execution logs

2026 Guardrail Tooling

ToolVersion/StatusNotes
NeMo Guardrailsv0.20.0NVIDIA, Colang modeling, parallel rails, native OpenTelemetry
Guardrails AIv0.9.1Open-source Python, Guardrails Hub validators
Lakera Guard to Check PointAcquisition completeAcquired by Check Point in 2025.09, integrated into the Infinity platform, sub-50ms latency
OpenAI Agents SDKCurrentinput/output/tool guardrails, human review, resumable state
Anthropic/Claude guardrailsCurrentjailbreak, prompt leak, character consistency, streaming refusal guidance

2026 Shift

NeMo Guardrails moved toward OpenTelemetry integration, so LLM calls, rail execution, and token usage can be unified in standard observability pipelines. Lakera Guard evolved into enterprise AI security after the Check Point acquisition.

Baseline and Sources

ItemBaseline DateRecheck ByPrimary Source
OpenAI guardrails/human review2026-05-172026-06-16https://developers.openai.com/api/docs/guides/agents/guardrails-approvals
OWASP MCP Top 102026-05-172026-06-16https://owasp.org/www-project-mcp-top-10/
OWASP Agentic Skills Top 102026-05-172026-06-16https://owasp.org/www-project-agentic-skills-top-10/
Claude guardrails/refusal handling2026-05-172026-06-16https://docs.claude.com/en/docs/test-and-evaluate/strengthen-guardrails/handle-streaming-refusals

Related docs

Verification Report

Structure, link, metric, and logic verification for LLMOps and AgentOps in Production

Updates

Changelog for LLMOps and AgentOps in Production

Updates

Harness Engineering · Change log for the Harness Engineering handbook

Prompt Engineering and Guardrails

Vercel Enterprise AI Platform · Design prompts, schemas, safety checks, and review gates for enterprise AI systems.

Verification Report

Claude Code Complete Guide · Verification checklist for the English Claude Code handbook locale.

Ch3. Evaluation Framework

Connect offline benchmarks with online operating signals

Ch5. Observability and SLOs

Collect model, tool, and policy execution as traceable signals and operate them through SLOs

On this page

Guardrail LayersFallback DesignGate Failure HandlingHuman Review and Resumable ApprovalApproval Queue SLA ExampleImplementation ComplexityOptions by LayerLatency OptimizationEscalation PatternsMCP and Skill Supply-Chain Guardrails2026 Guardrail ToolingBaseline and Sources