Add Maybe Don't Security Gateway Integration via MCP#1030
Closed
kenm47 wants to merge 1 commit intoOpenHands:mainfrom
Closed
Add Maybe Don't Security Gateway Integration via MCP#1030kenm47 wants to merge 1 commit intoOpenHands:mainfrom
kenm47 wants to merge 1 commit intoOpenHands:mainfrom
Conversation
This commit adds comprehensive integration support for the Maybe Don't security gateway, enabling runtime security policy enforcement for AI agent tool executions through the Model Context Protocol (MCP). Key Changes: - Added comprehensive documentation (docs/MAYBE_DONT_GATEWAY.md) - Created example gateway configuration (examples/maybe_dont/gateway-config.yaml) - Added working integration example (examples/01_standalone_sdk/27_maybe_dont_gateway.py) - Updated main README to reference MCP and security gateway support Architecture: The integration leverages OpenHands SDK's existing MCP client support to connect to Maybe Don't as an MCP gateway/proxy. Maybe Don't sits between the agent and downstream MCP tool servers, intercepting all tool calls and applying security policies before execution. Benefits: - No SDK code changes required - pure configuration - Transparent security enforcement via MCP protocol - Supports CEL-based rules and AI-powered validation - Comprehensive audit logging - Works with all MCP-compatible tools - Defense in depth when combined with LLMSecurityAnalyzer Usage: 1. Install and configure Maybe Don't gateway 2. Point OpenHands mcp_config to gateway endpoint 3. Tools calls automatically route through security gateway 4. Security policies enforced in real-time See docs/MAYBE_DONT_GATEWAY.md for complete integration guide. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Author
|
lol. not ready for primetime, my mistake for opening the PR here |
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.
Summary
This PR adds comprehensive integration support for the Maybe Don't security gateway, enabling runtime security policy enforcement for AI agent tool executions through the Model Context Protocol (MCP).
Problem with Previous Approach
The previous PR (#1) implemented Maybe Don't as a custom HTTP REST API endpoint, but this was architecturally incorrect. Maybe Don't is actually an MCP gateway/proxy, not a REST API service.
Correct Architecture
This integration leverages OpenHands SDK's existing MCP client support:
Changes
Documentation
docs/MAYBE_DONT_GATEWAY.md- Comprehensive integration guide covering:Example Configuration
examples/maybe_dont/gateway-config.yaml- Complete example gateway configuration with:Example Code
examples/01_standalone_sdk/27_maybe_dont_gateway.py- Working integration example demonstrating:examples/maybe_dont/README.md- Quick start guide and troubleshootingREADME Updates
Key Benefits
✅ No SDK Code Changes - Pure configuration, leverages existing MCP support
✅ Transparent Security - All tool calls automatically route through gateway
✅ Protocol Compliant - Uses standard MCP protocol, not custom APIs
✅ Comprehensive Policies - CEL rules + AI validation for defense in depth
✅ Full Audit Trail - Detailed logging of all operations and decisions
✅ Universal Compatibility - Works with all MCP-compatible tools
How It Works
Configure Gateway: Set up Maybe Don't with security policies in
gateway-config.yamlStart Gateway: Run
maybe-dont --config gateway-config.yamlPoint Agent to Gateway: Configure OpenHands to use gateway as MCP server:
Automatic Enforcement: All MCP tool calls now flow through Maybe Don't for security validation
Security Features
CEL-Based Rules (Deterministic)
AI-Powered Validation (Contextual)
Testing
To test this integration:
Comparison: Old vs New Approach
maybe_dont.pymodulemaybe_dont_configmcp_configDocumentation
Complete documentation available at:
docs/MAYBE_DONT_GATEWAY.mdexamples/maybe_dont/README.mdexamples/01_standalone_sdk/27_maybe_dont_gateway.pyChecklist