Skip to content

Repository files navigation

CAGE API

An extensible API framework for LLM-powered APIs with progressive extension levels (L0–L4), sandboxed code execution, and post-facto validation (RXR).

Features

  • Progressive extension levels — L0 (vanilla) through L4 (freeform code generation)
  • Sandboxed execution — AST-validated code runs with only registered capabilities in scope (Python or Deno/WASM backends)
  • RXR post-facto validation — execute-first, validate-later semantics with reversal support, auto-approve, and read-only detection
  • Multi-provider LLM support — Ollama, Anthropic (Claude), Google Gemini
  • MCP integration — auto-generated MCP server from OpenAPI + CAGE tool metadata with per-level tool filtering
  • Declarative registration@capability and @tool decorators for capabilities and endpoints

Quick Start

# Install dependencies
uv sync

# Start the hotel-reservation example
cd examples/deathstar/hotel-reservation
uv run uvicorn main:app --reload --timeout-keep-alive 300  # Terminal 1
uv run python agent_cli.py --level L1 "Find luxury hotels in San Francisco"  # Terminal 2

Examples

Each example follows the same pattern — start the API server, then run the agent CLI:

cd examples/<example-name>
uv run uvicorn main:app --reload --timeout-keep-alive 300  # Terminal 1
uv run python agent_cli.py --level L0                      # Terminal 2
Example Levels Key Feature
deathstar/hotel-reservation L0–L4 Full showcase: extension levels, RXR reversible mutations, pipelines
deathstar/media-microservices L0–L4 DeathStarBench media service extension points
deathstar/social-network L0–L4 DeathStarBench social-network service extension points
opal L0–L4 Real-world integration with OPAL (policy administration)

Note: examples/opal is a git submodule (a private fork). It is not required to use CAGE and is not fetched by default. To work with it, run git submodule update --init examples/opal.

Documentation

  • PROJECT_OVERVIEW.md — Detailed architecture, extension levels, RXR, and development guide
  • CLAUDE.md — Developer guidance for Claude Code

License

Released under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages