sha256:2cffbcf27330683021b38d58f7ada5c33156407f736e3515369b18a72c9ae1a0
Last pushed
6 days by olegselajev241
Type
Sandbox Kit
Manifest digest
sha256:2cffbcf27330683021b38d58f7ada5c33156407f736e3515369b18a72c9ae1a0
schemaVersion: "2"
kind: sandbox
name: herdr-crew
version: 0.4.1
displayName: Herdr Crew
description: |
Task sandbox running a nested Herdr server and a crew of coding agents
(Claude Code, Codex, pi with Google models) in rotating roles: a sandboxed orchestrator
that holds the goal, plus planner, implementer, and QC. The host only
delivers goals and arbitrates resources.
sourceURL: https://github.com/shelajev/herdr
args:
gemini_model:
default: gemini-3.8-flash
description: Google model the pi role pins with --provider google --model
image:
default: docker.io/olegselajev241/herdr-crew:latest
description: Herdr crew template image (published, linux/arm64; for local builds pass herdr-crew:local after scripts/sbx/build-crew-template.sh)
roles:
default: orchestrator=claude,planner=codex,implementer=claude,qc=pi
description: Role assignment for this task; the host rotates this per task and guarantees qc differs from implementer
sandbox:
image: ${{ kit.args.image }}
entrypoint:
- crew-entry
agentInstructions:
filename: AGENTS.md
content: |
## Herdr crew
This sandbox runs a crew of coding agents: an orchestrator that holds the
task goal and coordinates everyone through the local herdr CLI, plus a
planner, an implementer, and quality control. Your role is named in the
prompt you receive; read your prompt pack in `/home/agent/crew/roles/`
and follow it. Only the orchestrator drives other agents; every other
role works solely on what it is prompted with. The role-to-agent
assignment for this task is recorded in `/home/agent/crew/assignment`.
Shared crew files under `/home/agent/crew/`: `goal.md` (the goal, owned by
the orchestrator), `plan.md` (the plan, owned by the planner), `qc-log.md`
(findings and VERDICT lines, owned by qc), `status.md` (progress notes and
the final RESULT line, owned by the orchestrator), and `escalations.md`
(resource requests for the host to approve or deny).
permissions:
network:
allow:
- api.anthropic.com
- statsig.anthropic.com
- claude.ai
- console.anthropic.com
- platform.claude.com
- downloads.claude.ai
- claude.com
- code.claude.com
- api.openai.com
- openai.com
- auth.openai.com
- chatgpt.com
- files.openai.com
- codeload.github.com
- generativelanguage.googleapis.com
- github.com
- api.github.com
- raw.githubusercontent.com
- objects.githubusercontent.com
- release-assets.githubusercontent.com
- registry.npmjs.org
- archive.ubuntu.com
- security.ubuntu.com
- ports.ubuntu.com
- download.docker.com
credentials:
- service: anthropic
apiKey:
name: ANTHROPIC_API_KEY
inject:
- domain: api.anthropic.com
header: x-api-key
format: '%s'
- domain: claude.ai
header: x-api-key
format: '%s'
- domain: console.anthropic.com
header: x-api-key
format: '%s'
oauth:
tokenEndpoint:
host: platform.claude.com
path: /v1/oauth/token
sentinels:
accessToken: sk-ant-oat01-proxy-managed
refreshToken: sk-ant-ort01-proxy-managed
credentialFile:
path: ~/.claude/.credentials.json
template: '{"claudeAiOauth":{"accessToken":"{{.AccessToken}}","refreshToken":"{{.RefreshToken}}","expiresAt":{{.ExpiresAt}},"scopes":{{.ScopesJSON}}}{{if .PrimaryApiKey}},"primaryApiKey":"{{.PrimaryApiKey}}"{{end}}}'
skipIfEnv:
- ANTHROPIC_API_KEY
- service: openai
apiKey:
name: OPENAI_API_KEY
inject:
- domain: api.openai.com
header: Authorization
format: Bearer %s
- domain: openai.com
header: Authorization
format: Bearer %s
oauth:
tokenEndpoint:
host: auth.openai.com
path: /oauth/token
resourceHosts:
- chatgpt.com
sentinels:
accessToken: oai-oat01-proxy-managed
refreshToken: oai-ort01-proxy-managed
skipIfEnv:
- OPENAI_API_KEY
- service: gemini
required: true
apiKey:
name: GEMINI_API_KEY
proxyManaged: true
inject:
- domain: generativelanguage.googleapis.com
header: x-goog-api-key
format: '%s'
environment:
variables:
CODEX_HOME: /home/agent/.codex
GIT_TERMINAL_PROMPT: "0"
HERDR_CREW: "1"
HERDR_CREW_GEMINI_MODEL: ${{ kit.args.gemini_model }}
IS_SANDBOX: "1"
setup:
install:
- command: crew-check
user: "1000"
description: Verify herdr and the crew agent CLIs are present
- command: |
set -e
ws="${WORKSPACE_DIR:-/}"
esc=$(printf '%s' "$ws" | sed 's/\\/\\\\/g; s/"/\\"/g; s/\t/\\t/g; s/\r/\\r/g')
projects="\"/\": { \"hasTrustDialogAccepted\": true }"
[ "$ws" = "/" ] || projects="$projects, \"$esc\": { \"hasTrustDialogAccepted\": true }"
printf '%s\n' "{
\"bypassPermissionsModeAccepted\": true,
\"hasCompletedOnboarding\": true,
\"projects\": { $projects }
}" > /home/agent/.claude.json
chown agent:agent /home/agent/.claude.json
user: "0"
description: Seed Claude bypass/trust flags
- command: |
set -e
mkdir -p /home/agent/.claude
HELPER=''
if [ "${SBX_CRED_ANTHROPIC_MODE:-none}" != none ]; then
HELPER=' "apiKeyHelper": "echo proxy-managed",
'
fi
printf '%s' "{
\"themeId\": 1,
\"alwaysThinkingEnabled\": true,
${HELPER} \"permissions\": { \"defaultMode\": \"bypassPermissions\" },
\"bypassPermissionsModeAccepted\": true,
\"skipDangerousModePermissionPrompt\": true
}
" > /home/agent/.claude/settings.json
user: agent
description: Seed Claude settings.json from SBX_CRED_ANTHROPIC_MODE
- command: |
set -e
mkdir -p /home/agent/.codex
MODE="${SBX_CRED_OPENAI_MODE:-none}"
cat > /home/agent/.codex/config.toml << 'EOF'
approval_policy = "never"
sandbox_mode = "danger-full-access"
mcp_oauth_credentials_store = "file"
EOF
case "$MODE" in
oauth|apikey)
cat >> /home/agent/.codex/config.toml << 'EOF'
forced_login_method = "api"
EOF
;;
esac
if [ "$MODE" = oauth ]; then
cat >> /home/agent/.codex/config.toml << 'EOF'
model_provider = "sandboxd"
[model_providers.sandboxd]
name = "Sandbox Proxy"
base_url = "https://chatgpt.com/backend-api/codex"
experimental_bearer_token = "oai-oat01-proxy-managed"
requires_openai_auth = false
EOF
fi
case "$MODE" in
oauth|apikey)
cat > /home/agent/.codex/auth.json << 'EOF'
{
"OPENAI_API_KEY": "proxy-managed"
}
EOF
;;
*)
rm -f /home/agent/.codex/auth.json
;;
esac
user: agent
description: Seed Codex config/auth from SBX_CRED_OPENAI_MODE
startup:
- command:
- sh
- -c
- pgrep -f 'herdr server' >/dev/null 2>&1 || exec herdr server >>/tmp/herdr-server.log 2>&1
user: agent
background: true
description: Keep the headless herdr server running in detached sandboxes
files:
- path: /home/agent/crew/assignment
content: ${{ kit.args.roles }}
description: Role-to-agent assignment for this task
- path: /home/agent/crew/workdir
content: ${WORKDIR}
description: Absolute workspace path, read by the host task driver