feat(adapters): add Agent Kernel guardrail adapter - #71
Open
Pranjal0410 wants to merge 2 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
ACFInputGuardrailandACFOutputGuardrail. Both implement Agent Kernel's guardrail interface so ACF plugs in natively.Decision mapping:
Decision.ALLOW→GuardrailAction.ALLOWDecision.BLOCK→GuardrailAction.BLOCKSanitiseResult→GuardrailAction.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 registrationsdk/python/tests/adapters/test_agent_kernel.py— 12 tests, mocks agentkernel depsTests
12/12 adapter tests. Full suite 121/121.