Skip to content

feat(adapters): add Agent Kernel guardrail adapter - #71

Open
Pranjal0410 wants to merge 2 commits into
c2siorg:mainfrom
Pranjal0410:feat/agent-kernel-adapter
Open

feat(adapters): add Agent Kernel guardrail adapter#71
Pranjal0410 wants to merge 2 commits into
c2siorg:mainfrom
Pranjal0410:feat/agent-kernel-adapter

Conversation

@Pranjal0410

Copy link
Copy Markdown
Contributor

Second framework adapter. Integrates ACF as a guardrail in Agent Kernel (https://github.com/yaalalabs/agent-kernel), sitting alongside their OpenAI and Bedrock guardrail options.

What it does

Two classes: ACFInputGuardrail and ACFOutputGuardrail. Both implement Agent Kernel's guardrail interface so ACF plugs in natively.

Decision mapping:

  • Decision.ALLOWGuardrailAction.ALLOW
  • Decision.BLOCKGuardrailAction.BLOCK
  • SanitiseResultGuardrailAction.OVERRIDE (cleaned text replaces original)

Fail-closed on firewall errors. Lazy imports so the base SDK works without agentkernel installed.

Users can configure it in Agent Kernel's config (provider: acf) or instantiate directly.

Why Agent Kernel

It's framework-agnostic — sits above LangGraph, CrewAI, OpenAI Agents SDK, Google ADK. One adapter here means ACF works with all of them through Agent Kernel's runtime.

Files

  • sdk/python/acf/adapters/agent_kernel.py — adapter + factory registration
  • sdk/python/tests/adapters/test_agent_kernel.py — 12 tests, mocks agentkernel deps

Tests

12/12 adapter tests. Full suite 121/121.

ACF firewall as InputGuardrail and OutputGuardrail in Agent Kernel's guardrail system. Maps ALLOW/BLOCK/SANITISE to ALLOW/BLOCK/OVERRIDE. Lazy imports so SDK works without agentkernel installed. Fail-closed on firewall errors.
12 tests covering decision mapping, sanitise override, error handling, empty input edge cases. Full suite 121/121.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant