Install
$ agentstack add skill-yechao-zhang-red-team-agent-skills-agent-proxy ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ● Network access Used
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Agent Proxy Skill
Universal API Gateway: Given a URL to any AI agent API, this skill auto-discovers the protocol (REST, WebSocket, Gradio) and conducts conversations.
Critical: This works WITHOUT needing:
- ❌ Access to the target agent's source code
- ❌ The target agent's dependencies installed
- ❌ Knowledge of the target agent's implementation
You only need the agent's API URL.
Note on Web UIs: For browser-based agents (ChatGPT, Gemini, etc.), please use the dev-browser skill or Red Team's BrowserTransport instead. This skill is strictly for APIs.
Installation
# Install agent-proxy dependencies
cd ~/.claude/skills/agent-proxy
pip install -r requirements.txt
Workflow
User provides URL → Auto-detect Protocol (API/WS) → Create Protocol Adapter → Communicate
Quick Start
from agent_proxy import AgentProxy
# Just give it a URL - it figures out the protocol automatically
proxy = AgentProxy()
proxy.connect("http://localhost:8080/v1/chat/completions") # API Endpoint
# Now Claude Code speaks AS the user
response = proxy.say("Hello, I need help with Python")
response = proxy.say("Can you show me an example?")
# Get full conversation
print(proxy.history)
proxy.close()
Supported Agent Types (Auto-detected)
The skill auto-detects these communication patterns:
| URL Pattern | Detection | Method | |-------------|-----------|--------| | */v1/chat/completions | OpenAI-compatible API | POST JSON | | */v1/messages | Anthropic API | POST JSON | | */api/chat, */api/generate | Ollama/LLM APIs | POST JSON | | */api/sessions, */api/ws | REST+WebSocket API | REST + WebSocket | | ws://, wss:// | WebSocket | WS messages | | Gradio apps | Gradio API | gradio_client | | Custom endpoints | Probe & detect | Auto-detect |
Usage Modes
Mode 1: Auto-Detect (Recommended)
proxy = AgentProxy()
proxy.connect("https://api.some-agent.com/v1/chat") # Auto-detects protocol
response = proxy.say("Hello!")
Mode 2: With Hints
proxy = AgentProxy()
proxy.connect("https://api.example.com/v1/chat", hints={
"type": "openai", # Force OpenAI format
"api_key": "sk-...",
"model": "gpt-4"
})
Detection Process
When given a URL, the skill:
- Probe the endpoint
- Check response headers (Content-Type, Server)
- Look for API documentation endpoints (/docs, /openapi.json)
- Detect framework signatures (Gradio, Streamlit, FastAPI)
- Identify protocol
- REST API → detect request/response format
- WebSocket → establish WS connection
- Create appropriate adapter
- Configure authentication if needed
- Set up message format
- Handle streaming responses
For Claude Code Usage
When the user gives you an agent URL:
- Run
scripts/detect_agent.pyto analyze it - Use the detected config with
AgentProxy - Conduct the conversation as the user
Example workflow:
# Step 1: Detect
python scripts/detect_agent.py "http://localhost:8080"
# Output: Detected OpenAI-compatible API at /v1/chat/completions
# Config: {"type": "openai_api", "endpoint": "...", "model": "..."}
# Step 2: Use
python scripts/talk.py --url "http://localhost:8080" --message "Hello!"
Handling Authentication
If the agent requires authentication:
proxy.connect("https://api.example.com/chat", hints={
"auth": {
"type": "bearer", # or "api_key", "basic", "header"
"token": "your-token"
}
})
Output
All conversations are logged:
{
"agent_url": "http://localhost:8080",
"detected_type": "openai_api",
"turns": [
{"role": "user", "content": "Hello"},
{"role": "assistant", "content": "Hi! How can I help?"}
]
}
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: yechao-zhang
- Source: yechao-zhang/red-team-agent-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.