Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add ibm-self-serve-assets/building-blocks --skill real-time-guardrailsgit clone --depth 1 https://github.com/ibm-self-serve-assets/building-blocksWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/ibm-self-serve-assets/building-blocks/real-time-guardrails)<a href="https://agentmods.dev/skills/ibm-self-serve-assets/building-blocks/real-time-guardrails"><img src="https://agentmods.dev/badge/skills/ibm-self-serve-assets/building-blocks/real-time-guardrails/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/ibm-self-serve-assets/building-blocks/real-time-guardrails"><img src="https://agentmods.dev/badge/skills/ibm-self-serve-assets/building-blocks/real-time-guardrails.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00131 | $0.04792 |
| Opus 5 | $0.00066 | $0.02396 |
| Sonnet 5 | $0.00026 | $0.00958 |
| Haiku 4.5 | $0.00013 | $0.00479 |
Grade B, and why
real-time-guardrails scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Asks for rootmediumPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
**RULE 1 — Never paste live credentials into chat.** Guide the user to set `WATSONX_APIKEY` and `WXG_SERVICE_INSTANCE_ID` in a `.env` file (`chmod 600`). Use `read -s` to enter the key without leaving it in shell history How it starts
The opening of the file, as written. The whole thing — 245 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Real-Time Guardrails
This skill helps developers wire production-grade safety and quality guardrails into AI agents using IBM's real-time-guardrails package (backed by watsonx.governance). The package ships 28 metrics across safety, RAG-generation, RAG-retrieval, quality, topic, pattern, and tool-call categories, with a 3-state Pass/Flag/Block action model, threshold policy as code, and audit logging.
Mandatory Rules
Read every time. Violating any of these causes silent or costly failures in production.
RULE 1 — Never paste live credentials into chat. Guide the user to set WATSONX_APIKEY and WXG_SERVICE_INSTANCE_ID in a .env file (chmod 600). Use read -s to enter the key without leaving it in shell history. If a user pastes a key into chat, interrupt and tell them to rotate it at IBM Cloud → Manage → Access (IAM) → API keys.
RULE 2 — WXG_PROJECT_ID is optional. The package runs 25 metrics with just WATSONX_APIKEY + WXG_SERVICE_INSTANCE_ID. WXG_PROJECT_ID unlocks 3 LLM-as-judge metrics (Answer Completeness, Conciseness, Tool Call Relevance). Don't force watsonx.ai on partners who don't want LLM-judge cost.
RULE 3 — Python 3.11–3.13 only. The IBM SDK chain doesn't support 3.14 yet. If the user is on 3.14, rebuild their venv with 3.11/3.12/3.13.
RULE 4 — Install from source with the [all] extra; use a dedicated venv. The package is not on PyPI today — partners install from a building-blocks repo clone via pip install -e "<repo>/ai-trust/real-time-guardrails/assets/sdk[all]". The quotes are required on zsh (macOS default) — without them, the shell parses [all] as an array subscript, silently produces an empty path, and pip errors with is not a valid editable requirement. The bundled setup.sh quotes correctly. Without [metrics,llmaj] (always part of base install), registry build fails with ModuleNotFoundError: No module named 'unitxt'. If the user reports ResolutionImpossible during install, their existing venv has stricter pins than the SDK can accept (typically on pydantic or httpx) — load reference/setup-and-credentials.md for the conflict matrix + dry-run recipe.
What ships with it
32 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- assets/env.example 1.1 KB
- assets/thresholds.example.yaml 737 B
- examples/audit_log_sample.jsonl 3.6 KB
- examples/backend_guardrails_proxy.py 5.7 KB runs code
- examples/custom_metric_example.py 5.8 KB runs code
- examples/dashboard_skeleton.jsx 10 KB
- examples/decorator_example.py 7.2 KB runs code
- examples/frontend_chat_integration.jsx 5.2 KB
- examples/full_pipeline.py 7.9 KB runs code
- examples/input_safety.json 269 B
- examples/langchain_callback.py 5.5 KB runs code
- examples/middleware_fastapi.py 4.4 KB runs code
- examples/middleware_flask.py 3.1 KB runs code
- examples/pattern_keywords.json 434 B
- examples/rag_generation.json 416 B
- examples/rag_retrieval.json 605 B
- examples/sample_payloads.json 2.6 KB
- examples/tool_call.json 984 B
- examples/wxo_service_middleware.py 11 KB runs code
- examples/wxo_tool_wrapper.py 8.2 KB runs code
- README.md 5.4 KB
- reference/audit-and-observability.md 8.0 KB
- reference/auto-trigger-patterns.md 9.9 KB
- reference/custom-metric-authoring.md 8.9 KB
- reference/deployment.md 5.8 KB
- reference/frontend-integration.md 5.4 KB
- reference/integration-patterns.md 9.5 KB
- reference/metrics-catalog.md 12 KB
- reference/setup-and-credentials.md 7.3 KB
- reference/watsonx-orchestrate-integration.md 11 KB
- setup.sh 5.4 KB runs code
- USAGE-GUIDE.md 11 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 12d ago First seen · 245 lines · 131 tokens per session scan B 0b3eadf7c797
real-time-guardrails is a skill published in the GitHub repository ibm-self-serve-assets/building-blocks (24 stars, last pushed yesterday), licensed Apache-2.0. It adds 131 tokens to every session and 4,792 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
embeddings
Vector embeddings with HNSW indexing, sql.js persistence, and hyperbolic support. 75x faster with agentic-flow integration. Use when: semantic search, pattern matching, similarity queries, knowledge retrieval. Skip when: exact text matching, simple lookups, no semantic understanding needed.
agent-platform-rag-engine-management
Manage and query Agent Platform RAG Engine Corpora and retrieve grounded contexts using the Google GenAI SDK. Use when listing RAG corpora or files, inspecting a corpus, retrieving contexts, or generating content grounded in a RAG corpus. Do not use for standard database queries (use SQL/Spanner skills), Google…
llm-app-patterns
Production-ready patterns for building LLM applications. Covers RAG pipelines, agent architectures, prompt IDEs, and LLMOps monitoring. Use when designing AI applications, implementing RAG, building agents, or setting up LLM observability.
9router-embeddings
Generate vector embeddings via 9Router /v1/embeddings using OpenAI / Gemini / Mistral / Voyage / Nvidia / GitHub embedding models for RAG, semantic search, similarity. Use when the user wants embeddings, vectors, RAG, semantic search, or to embed text.
azure-search-documents-dotnet
Azure AI Search SDK for .NET (Azure.Search.Documents). Use for building search applications with full-text, vector, semantic, and hybrid search. Covers SearchClient (queries, document CRUD), SearchIndexClient (index management), and SearchIndexerClient (indexers, skillsets). Triggers: "Azure Search .NET"…
browserwing-admin
Manage and operate BrowserWing — an intelligent browser automation platform. Install dependencies, configure LLM, create/manage/execute automation scripts, use AI-driven exploration to generate scripts, browse the script marketplace, and troubleshoot issues.