Add beginner examples safe t1106#121
Open
geekysatbir wants to merge 4 commits intosafe-agentic-framework:mainfrom
Open
Add beginner examples safe t1106#121geekysatbir wants to merge 4 commits intosafe-agentic-framework:mainfrom
geekysatbir wants to merge 4 commits intosafe-agentic-framework:mainfrom
Conversation
Added practical Python code examples demonstrating: - Simple loop detection using call history tracking - Basic loop prevention with iteration limits and convergence checks - Log pattern analysis for identifying loop indicators This addition helps beginners understand autonomous loop exploits through hands-on, runnable code examples. Signed-off-by: Satbir Singh <satbisin@cisco.com>
Signed-off-by: Satbir Singh <satbisin@cisco.com>
Signed-off-by: Satbir Singh <satbisin@cisco.com>
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 a comprehensive Beginner-Friendly Examples section to SAFE-T1106 (Autonomous Loop Exploit), providing practical, runnable Python code examples that help developers and security practitioners understand how autonomous loops work and how to detect and prevent them in MCP environments.
What's Added
Key Features:
Example 1: Simple Loop Detection - Python
LoopDetectorclass that tracks repeated identical tool calls within a time windowExample 2: Basic Loop Prevention -
SafeAgentExecutorclass with iteration limits and convergence checksExample 3: Log Pattern Analysis - Function to analyze logs for loop indicators
Technical Highlights:
Value Proposition:
This enhancement makes SAFE-T1106 more accessible to developers new to MCP security, providing concrete examples that bridge the gap between theoretical attack descriptions and practical implementation. The code examples serve as both educational tools and starting points for implementing loop detection and prevention in production MCP environments.
Type of Contribution
Testing
Related Techniques
This enhancement complements the existing SAFE-T1106 documentation and helps practitioners understand:
Impact