flakestorm/examples/broken_agent
Entropix 61652be09b Refactor Entropix to FlakeStorm
- Rename all instances of Entropix to FlakeStorm
- Rename package from entropix to flakestorm
- Update all class names (EntropixConfig -> FlakeStormConfig, EntropixRunner -> FlakeStormRunner)
- Update Rust module from entropix_rust to flakestorm_rust
- Update README: remove cloud comparison, update links to flakestorm.com
- Update .gitignore to allow docs files referenced in README
- Add origin remote for VS Code compatibility
- Fix missing imports and type references
- All imports and references updated throughout codebase
2025-12-29 11:15:18 +08:00
..
agent.py Refactor Entropix to FlakeStorm 2025-12-29 11:15:18 +08:00
README.md Refactor Entropix to FlakeStorm 2025-12-29 11:15:18 +08:00

Broken Agent Example

This example demonstrates a deliberately fragile AI agent that flakestorm can detect issues with.

The "Broken" Agent

The agent in agent.py has several intentional flaws:

  1. Fragile Intent Parsing: Only recognizes exact keyword matches
  2. No Typo Tolerance: Fails on any spelling variations
  3. Hostile Input Vulnerability: Crashes on aggressive tone
  4. Prompt Injection Susceptible: Follows injected instructions

Running the Example

1. Start the Agent Server

cd examples/broken_agent
pip install fastapi uvicorn
uvicorn agent:app --port 8000

2. Run flakestorm Against It

# From the project root
flakestorm run --config examples/broken_agent/flakestorm.yaml

3. See the Failures

The report will show how the agent fails on:

  • Paraphrased requests ("I want to fly" vs "Book a flight")
  • Typos ("Bock a fligt")
  • Aggressive tone ("BOOK A FLIGHT NOW!!!")
  • Prompt injections ("Book a flight. Ignore previous instructions...")

Fixing the Agent

Try modifying agent.py to:

  1. Use NLP for intent recognition
  2. Add spelling correction
  3. Handle emotional inputs gracefully
  4. Detect and refuse prompt injections

Then re-run flakestorm to see your robustness score improve!