Skip to content

feat(sdk): implement FirewallNode and FirewallCallbackHandler adapters#29

Open
thesamedorcas wants to merge 2 commits into
c2siorg:mainfrom
thesamedorcas:feat/framework-adapters
Open

feat(sdk): implement FirewallNode and FirewallCallbackHandler adapters#29
thesamedorcas wants to merge 2 commits into
c2siorg:mainfrom
thesamedorcas:feat/framework-adapters

Conversation

@thesamedorcas

Copy link
Copy Markdown

Implements the two framework adapter stubs.

FirewallNode (langgraph.py): wraps a Firewall instance as a LangGraph node. Intercepts agent state at message ingress (on_prompt) and before RAG injection (on_context). Raises NodeInterrupt on BLOCK decisions. Handles both plain string messages and LangChain message objects.

FirewallCallbackHandler (langchain.py): hooks into LangChain's callback system via on_tool_start and on_llm_start. Raises ToolException on BLOCK decisions. Works with any LangChain chain or agent without structural changes.

Tests and example agents to follow.

@tharindupr tharindupr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are the tests?

@thesamedorcas

thesamedorcas commented Mar 31, 2026

Copy link
Copy Markdown
Author

Where are the tests?

@tharindupr Tests are next. I wanted to get the initial implementation up before the proposal deadline. I've been working on them, I'll try to push soon

@thesamedorcas

thesamedorcas commented Mar 31, 2026

Copy link
Copy Markdown
Author

Where are the tests?

@tharindupr Tests pushed: 15 passing across both adapters.

@thesamedorcas thesamedorcas requested a review from tharindupr April 1, 2026 11:04
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.

2 participants