Agents
Agents are AI-powered coding assistants that execute tasks within AgentGate’s orchestration framework. AgentGate supports multiple agent drivers, each with different capabilities, billing models, and use cases.What Are Agents
An agent is an AI system that can:- Read and write code: Understand codebases and make changes
- Execute commands: Run tests, builds, and other shell commands
- Use tools: Leverage MCP servers, browser automation, and custom tools
- Iterate on feedback: Respond to verification failures and improve code
Available Drivers
- Claude Code Subscription
- Claude Code API
- Claude Agent SDK
- OpenCode
- OpenAI Codex
Use your Claude Pro/Max subscriptionThe default driver that uses your Claude subscription for billing instead of API credits.Requirements:
- Active Claude Pro or Max subscription
- OAuth credentials at
~/.claude/.credentials.json - Claude CLI installed
| Feature | Supported |
|---|---|
| Session Resume | Yes |
| Structured Output | Yes |
| Tool Restriction | Yes |
| Timeout Control | Yes |
| Streaming | Yes |
| Cost Tracking | No (subscription) |
Agent Specification
Configure agents in theexecution.agent section of your TaskSpec:
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
driver | string | claude-code-subscription | Agent driver to use |
model | string | varies | AI model (e.g., claude-sonnet-4-20250514) |
maxTokens | number | 200000 | Maximum context tokens |
temperature | number | 0.7 | Generation temperature (0-2) |
systemPrompt | string | - | Custom system prompt |
tools | ToolSpec[] | - | Tool configurations |
mcpServers | object | - | MCP server configurations |
capabilities | object | - | Capability flags |
Agent Capabilities
Capabilities define what actions an agent can perform:Standard Capabilities
AgentGate defines these standard capability names:| Capability | Description |
|---|---|
network | Network access for HTTP requests |
filesystem | Read and write files |
shell | Execute shell commands |
browser | Browser automation (Playwright, etc.) |
docker | Docker container operations |
database | Database access |
code-execution | Execute code in various languages |
tool-use | Use MCP tools and servers |
Capability Matching
When a task has capability requirements, AgentGate matches them against available agents:Tools and MCP Servers
Tool Configuration
Enable or disable specific tools:MCP Server Configuration
Configure Model Context Protocol servers:Agent Request Flow
When AgentGate executes a task, it creates anAgentRequest:
Agent Result
Agents return structured results:Constraints
Control agent behavior with constraints:Permission Modes
| Mode | Description | Use Case |
|---|---|---|
plan | Agent plans but asks before executing | High-risk changes |
acceptEdits | Agent can edit files automatically | Normal development |
bypassPermissions | Full autonomy | Trusted automation |
Session Management
Agents can resume sessions for multi-iteration tasks:Session Resume
When a gate fails and triggers iteration:- AgentGate captures the
sessionIdfrom the result - Next iteration passes
sessionIdin the request - Agent resumes with full conversation context
- Feedback from failed gates is appended
Billing Methods
Subscription Billing
Theclaude-code-subscription driver uses your Claude Pro/Max subscription:
- No per-token charges
- Rate limits based on subscription tier
- Requires OAuth authentication
API Billing
Theclaude-code-api and claude-agent-sdk drivers use API credits:
- Pay-per-token pricing
- Higher rate limits available
- Cost tracked in
totalCostUsd
Driver Selection
AgentGate uses a driver registry to select agents:Automatic Selection
If you don’t specify a driver, AgentGate selects based on availability:- Check if
claude-code-subscriptionis available (subscription valid) - Fall back to
claude-code-apiif API key is set - Try other registered drivers
Best Practices
1
Choose the Right Driver
- claude-code-subscription: Best for regular development work
- claude-agent-sdk: Best for complex orchestration
- claude-code-api: Best when you need cost tracking
2
Set Appropriate Limits
3
Use Constraints Wisely
- Disable unused tools to reduce context
- Set
maxTurnsto prevent infinite loops - Use
additionalSystemPromptfor task-specific guidance
4
Leverage Session Resume
- Use
ralphstrategy for session continuity - Provide context pointers for large codebases
- Enable
promptHotReloadfor iterative refinement
Troubleshooting
Subscription not available
Subscription not available
Check that:
- You have an active Claude Pro/Max subscription
- OAuth credentials exist at
~/.claude/.credentials.json - The credentials are not expired
API key not working
API key not working
Verify your API key:
Agent timeout
Agent timeout
Increase timeout in your TaskSpec:
Tool not available
Tool not available
Check tool configuration: