agent-kernel: Skill for Claude Code

.agents/skills/ak-dev-new-guardrail-provider/SKILL.md

ak-dev-new-guardrail-provider is a skill for Claude Code, Codex from yaalalabs/agent-kernel. It costs 73 tokens per session (3,213 once invoked), scanned A, original, Apache-2.0.

A guide for adding a new guardrail provider to Agent Kernel. A guardrail is a check that can inspect or stop an agent's input or output for safety reasons.

In plain words
What is it for?
Use it to implement input and output checks, connect services such as moderation or personal-data detection, register the provider, and test it.
Why use it?
It explains how to connect another content-safety service to the existing system and register its settings and tests.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is yaalalabs/agent-kernel's own configuration. It tells Claude Code and Codex how to work on agent-kernel itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything agent-kernel configures →

Reuse

Borrowing it

Nothing to install: this file belongs to yaalalabs/agent-kernel. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/yaalalabs/agent-kernel/develop/.agents/skills/ak-dev-new-guardrail-provider/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/yaalalabs/agent-kernel

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for ak-dev-new-guardrail-provider

README.md
[![agentmods](https://agentmods.dev/badge/skills/yaalalabs/agent-kernel/ak-dev-new-guardrail-provider/github.svg)](https://agentmods.dev/skills/yaalalabs/agent-kernel/ak-dev-new-guardrail-provider)
Your own site
<a href="https://agentmods.dev/skills/yaalalabs/agent-kernel/ak-dev-new-guardrail-provider"><img src="https://agentmods.dev/badge/skills/yaalalabs/agent-kernel/ak-dev-new-guardrail-provider/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.

agentmods 80×15 button for ak-dev-new-guardrail-provider

Your own site · 80×15
<a href="https://agentmods.dev/skills/yaalalabs/agent-kernel/ak-dev-new-guardrail-provider"><img src="https://agentmods.dev/badge/skills/yaalalabs/agent-kernel/ak-dev-new-guardrail-provider.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,213 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00073 $0.03213
Opus 5 $0.00036 $0.01606
Sonnet 5 $0.00015 $0.00643
Haiku 4.5 $0.00007 $0.00321

Measured today against content hash 6b174b4b7de7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

ak-dev-new-guardrail-provider scanned grade A with 0 findings 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 today.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/ak-dev-new-guardrail-provider/SKILL.md · 304 lines

How it starts

The opening of the file, as written. The whole thing — 304 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Adding a New Guardrail Provider

This guide walks through adding a new guardrail provider to Agent Kernel. Use the existing OpenAI (ak-py/src/agentkernel/guardrail/openai.py), Bedrock (ak-py/src/agentkernel/guardrail/bedrock.py), and Walled AI (ak-py/src/agentkernel/guardrail/walledai.py) implementations as reference.

Existing Providers

Provider Type value Features Extra
OpenAI openai Content moderation, jailbreak detection, PII detection (via config JSON) agentkernel[openai]
AWS Bedrock bedrock AWS-managed guardrails (ID + version) agentkernel[aws]
Walled AI walledai Content safety + PII redaction/unmasking (via pii flag) agentkernel[walledai]

Architecture Overview

Agent Kernel's guardrail system uses the hook mechanism:

  • Input guardrails subclass the no-op InputGuardrail class in guardrail/guardrail.py (itself a PreHook) — they inspect incoming requests and can halt execution by returning an AgentReply instead of passing through
  • Output guardrails subclass the no-op OutputGuardrail class (itself a PostHook) — they inspect agent replies and can modify or replace the response
  • BaseGuardrailUtil (also in guardrail/guardrail.py) provides shared text-extraction helpers and is mixed into concrete guardrail classes
  • Factories in guardrail.py select the appropriate provider based on AKConfig.guardrail configuration; unknown types raise an exception, and the no-op classes are returned only when guardrails are disabled
  • Guardrails are registered as system hooks in Runtime, meaning they apply to all agents automatically

Step-by-Step

1. Create the Guardrail Provider File

Create ak-py/src/agentkernel/guardrail/<provider>.py.

2. Implement the Base Provider Class

The base class is a plain provider-specific class that holds shared client/config setup. The concrete input/output classes (steps 3 and 4) combine it with the no-op InputGuardrail/OutputGuardrail hooks and the BaseGuardrailUtil mixin. Real examples: class OpenAIInputGuardrail(BaseGuardrailUtil, BaseOpenAIGuardrail, InputGuardrail) in openai.py, class BedrockInputGuardrail(BaseGuardrailUtil, BaseBedrockGuardrail, InputGuardrail) in bedrock.py, and class WalledAIInputGuardrail(InputGuardrail, WalledAIGuardrailBase) in walledai.py.

Read the full file on GitHub · 304 lines

Changes

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.

  1. today Changed · +2 lines 6b174b4b7de7
  2. 2d ago Changed b405de865a47
  3. 9d ago First seen · 302 lines · 73 tokens per session scan A 149a12506756

Subscribe to this mod's changes

ak-dev-new-guardrail-provider is a skill published in the GitHub repository yaalalabs/agent-kernel (166 stars, last pushed yesterday), licensed Apache-2.0. It adds 73 tokens to every session and 3,213 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.