Skip to main content

Claude SDK Agent

Back to agent catalog | main doc

Type: Custom A2A Framework: Anthropic SDK / OpenAI-compatible (httpx) LLM: LiteMaaS (llama-scout-17b) Supervisor: No Sandbox Model: Tier 3 (plain Deployment, no supervisor) Status: Deployed, tested (Kind + HyperShift)

1. Overview

Code review agent using the Anthropic Python SDK with automatic format switching. When ANTHROPIC_BASE_URL points to a non-Anthropic endpoint (e.g., LiteMaaS), uses httpx with OpenAI chat/completions format. A2A protocol implemented manually via Starlette (Anthropic SDK has no built-in A2A wrapper unlike Google ADK).

2. Architecture

3. Files

deployments/openshell/agents/claude-sdk-agent/
├── agent.py # Starlette A2A server + Anthropic/OpenAI client
├── Dockerfile # python:3.12-slim
├── deployment.yaml # Deployment + Service + AgentRuntime CR
├── policy-data.yaml # OPA policy
├── sandbox-policy.rego # OPA Rego rules
└── requirements.txt # anthropic, starlette, uvicorn, httpx

4. Deployment

Same as adk-agent (docker build + kind load, or OCP binary build).

5. Capabilities

CapabilitySupportedNotes
A2A protocolYesManual Starlette implementation
Multi-turn contextNoStateless — each request independent
Tool callingNoLLM prompt-based only
Subagent delegationNoSingle-purpose agent
Memory/knowledgeNoNo persistent state
Skill executionVia promptSkill markdown injected into system prompt
HITL approvalL0OPA policy mounted, not enforced

6. Rossoctl Integration

6.1 Communication Adapter

A2A JSON-RPC (already implemented).

6.2 Session Management

None — stateless. Backend stores turns in PostgreSQL.

6.3 Observable Events

EventSourceRossoctl UI ComponentPhase
LLM responseA2A response artifactsAgentChatCurrent
Error (LLM unavailable)Generic error messageAgentChatCurrent

6.4 FileBrowser Integration

N/A — no workspace.

7. LLM Compatibility

ProviderProtocolWorks?Notes
LiteMaaSOpenAI-compatYesAuto-detected via base_url
Anthropic APIClaude messagesYesNative SDK
Budget ProxyOpenAI-compatYesDefault config

8. Skill Execution

The Claude SDK agent is the most capable skill executor in the PoC — it supports all skill types and has the most passing skill tests. Skills are injected by embedding the skill markdown (from .claude/skills/<name>/SKILL.md) into the A2A prompt.

Supported Skills

SkillTestStatusHow It Works
PR Reviewtest_pr_review__claude_sdk_agentPASSSkill markdown from github:pr-review injected into prompt
RCAtest_rca__claude_sdk_agentPASSSkill markdown from rca:ci injected; analyzes CI failure logs
Security Reviewtest_security_review__claude_sdk_agentPASSPrompt-based K8s manifest security analysis
Real GitHub PRtest_review_real_github_pr__claude_sdkPASSFetches PR #1300 diff via GitHub API, reviews with LLM
RCA CI Logstest_rca_style_log_analysis__claude_sdkPASSAnalyzes real CI log output for root causes
Code Generationtest_code_generation__claude_sdkPASSGenerates Python code from natural language prompt
TDDNot testedCan execute test:review skill via prompt injection
Docs ReviewNot testedCan execute docs:review skill via prompt injection

Running Skills Manually

# Port-forward to Claude SDK agent
kubectl port-forward -n team1 svc/claude-sdk-agent 8002:8000 &

# PR Review skill
curl -s -X POST http://localhost:8002/ \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0", "id": "1", "method": "message/send",
"params": {"message": {"role": "user",
"parts": [{"type": "text", "text": "Review this code change for issues:\n\n```diff\n- password = request.form[\"password\"]\n+ password = hashlib.md5(request.form[\"password\"]).hexdigest()\n```"}]
}}
}' | python3 -m json.tool

# RCA with real CI log
curl -s -X POST http://localhost:8002/ \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0", "id": "2", "method": "message/send",
"params": {"message": {"role": "user",
"parts": [{"type": "text", "text": "Analyze this CI failure:\n\nERROR: Connection refused to postgres:5432\nFATAL: role \"test_user\" does not exist\n\nContext: This started after we upgraded the PostgreSQL Helm chart from 14.x to 15.x"}]
}}
}' | python3 -m json.tool

kill %1

Prerequisites

  • LiteLLM model proxy running in team1
  • OPENSHELL_LLM_AVAILABLE=true for E2E tests
  • .env.maas with LiteMaaS credentials (or substitute your LLM endpoint)

9. Testing Status

Test FileTestsPassSkipNotes
test_02_a2a_connectivity220Hello + agent card
test_05_multiturn321Sequential + isolation pass; continuity skips
test_07_skill_execution752PR review, RCA, security, real GH PR, RCA logs

10. Sandbox Deployment Models

ModelSupportedNotes
Mode 1: Rossoctl DeploymentCurrentStandard Deployment + Service
Mode 1 + SupervisorPossibleWould enable OPA enforcement
Mode 2: Sandbox CRNot applicableCustom code, not a CLI agent