Miner-facing map for the ordered review → eval Intel TDX path. Authoritative implementation and full flag surface live in BaseIntelligence/agent-challenge:
python -m agent_challenge.selfdeployand that repo'sdocs/miner/self-deploy.md.
agent-recipe does not vendor the agent-challenge service. Install the package,
then run the module (or use the thin agent-recipe selfdeploy -- … wrapper).
git clone https://github.com/BaseIntelligence/agent-challenge.git
cd agent-challenge
python -m venv .venv && source .venv/bin/activate
pip install -e .
# Discovery (safe; no Phala spend)
python -m agent_challenge.selfdeploy --helpFrom agent-recipe (after the install above is available on PYTHONPATH / same venv):
cd /path/to/agent-recipe
pip install -e ".[dev]"
# same venv also: pip install -e /path/to/agent-challenge
agent-recipe selfdeploy-status --json
agent-recipe selfdeploy-help
agent-recipe selfdeploy -- --help
# equivalent:
python -m agent_challenge.selfdeploy --helpIf agent-challenge is not installed, agent-recipe selfdeploy-help exits non-zero and
prints an install hint. That is expected offline discovery, not a product failure.
| Concern | Value |
|---|---|
| Plane | Phala Cloud Intel TDX CPU CVMs (no GPU) |
| Stages | Miner funds attested review, then after verified allow, attested eval |
| Validator owns | Measurement allowlists, golden key-release, quote verification |
| Money cap | Hard preference $20; prefer tdx.small / tdx.medium |
| Secrets | OPENROUTER_API_KEY enters via Phala encrypted_env (never compose plaintext) |
| Gateway | Production refuses Base LLM gateway; OpenRouter-in-TEE only |
| Measured OpenRouter model | x-ai/grok-4.5 (agent-challenge REVIEW_MODEL pin) |
Challenge service production flags must be ON:
phala_attestation_enabled/CHALLENGE_PHALA_ATTESTATION_ENABLEDattested_review_enabled
Only an explicit deploy (without --dry-run) or teardown reaches Phala for
spend. Dry-runs, --help, unit tests, and offline tooling never create CVMs.
| Secret | Required for | Notes |
|---|---|---|
OPENROUTER_API_KEY |
Live review/eval LLM | Encrypt into CVM; never commit or log |
PHALA_CLOUD_API_KEY |
Live CVM create/teardown | Host env only; never print |
| Miner hotkey signing | prepare/deploy auth | Prefer remote-sign; MINER_HOTKEY_MNEMONIC / MINER_HOTKEY_URI for --auto-sign |
When PHALA_CLOUD_API_KEY is absent, only run --help / documented dry-run
paths. Do not attempt live deploy without a budget decision (cap $20 like AC docs).
# Safe discovery (no spend)
unset PHALA_CLOUD_API_KEY # or leave unset
python -m agent_challenge.selfdeploy --help
agent-recipe selfdeploy-status --json
# Expect JSON field: "phala_key_present": falseNames-only env template: .env.example.
review prepare → review deploy → review deployed → review result
(need verified allow before eval)
eval prepare → eval deploy → eval result
always: teardown (review + eval) when finished
CLI subcommands under each stage:
review: prepare, deploy, deployed, result, history, cancel, retry, teardown
eval: prepare, deploy, result, status, cancel, retry, failure, teardown
review deploy / eval deploy fetch the current signed prepare response and
immediately consume the one-time capability. A standalone prepare is for custom
clients; the CLI redacts capabilities from output and persisted JSON.
Reject / escalate / expiry / attestation failure must not create benchmark work.
python -m agent_challenge.selfdeploy --help
python -m agent_challenge.selfdeploy review deploy --help
python -m agent_challenge.selfdeploy eval deploy --help
agent-recipe selfdeploy-help
agent-recipe selfdeploy -- --helpRequires a real submission id, hotkey signing material, and challenge base URL.
Still safe: --dry-run does not provision Phala CVMs.
export OPENROUTER_API_KEY=... # used only if assignment path needs encrypt prep; never log
# PHALA_CLOUD_API_KEY may stay unset for pure dry-run validation paths
python -m agent_challenge.selfdeploy review deploy \
--base-url https://<challenge-host> \
--submission-id <id> \
--hotkey <miner-ss58> \
--auto-sign \
--dry-runVia agent-recipe wrapper:
agent-recipe selfdeploy -- review deploy \
--base-url https://<challenge-host> \
--submission-id <id> \
--hotkey <miner-ss58> \
--auto-sign \
--dry-runpython -m agent_challenge.selfdeploy eval deploy \
--base-url https://<challenge-host> \
--submission-id <id> \
--hotkey <miner-ss58> \
--auto-sign \
--dry-runUseful for measurement/cost rehearsal without a submission:
python -m agent_challenge.selfdeploy deploy \
--image ghcr.io/baseintelligence/agent-challenge-canonical@sha256:<digest> \
--key-release-url https://validator.example/keyrelease \
--money-cap-usd 20 \
--dry-runIf PHALA_CLOUD_API_KEY is unset, a non-dry-run deploy errors clearly without
printing the key and without a Phala create call.
Only with PHALA_CLOUD_API_KEY set, money cap respected (≤ $20), and a decision
to spend. Prefer --dry-run immediately before live create.
export OPENROUTER_API_KEY=...
export PHALA_CLOUD_API_KEY=... # host only; never commit / never print
python -m agent_challenge.selfdeploy review deploy \
--base-url https://<challenge-host> \
--submission-id <id> \
--hotkey <miner-ss58> \
--auto-sign \
--openrouter-key-env OPENROUTER_API_KEY \
--phala-api https://cloud-api.phala.com/api/v1 \
--review-instance-type tdx.small \
--eval-instance-type tdx.small \
--review-runtime-hours 6 \
--eval-runtime-hours 6 \
--money-cap-usd 20Explicit signature form (no --auto-sign):
python -m agent_challenge.selfdeploy review deploy \
--base-url https://<challenge-host> \
--submission-id <id> \
--hotkey <miner-ss58> \
--signature <signature> \
--nonce <unique-nonce> \
--timestamp <timestamp> \
--openrouter-key-env OPENROUTER_API_KEY \
--phala-api https://cloud-api.phala.com/api/v1 \
--review-instance-type tdx.small \
--eval-instance-type tdx.small \
--money-cap-usd 20python -m agent_challenge.selfdeploy review result \
--base-url https://<challenge-host> \
--submission-id <id> \
--hotkey <miner-ss58> \
--auto-signPublic TEE math (no miner signature): GET /submissions/{id}/review/tee on the
challenge host (see agent-challenge attestation-tee).
python -m agent_challenge.selfdeploy eval deploy \
--base-url https://<challenge-host> \
--submission-id <id> \
--hotkey <miner-ss58> \
--auto-sign \
--llm-cost-limit-env LLM_COST_LIMIT \
--phala-api https://cloud-api.phala.com/api/v1 \
--eval-instance-type tdx.small \
--money-cap-usd 20Base LLM gateway secrets are not required and must not be injected
(BASE_GATEWAY_TOKEN / BASE_LLM_GATEWAY_URL removed from eval required secrets).
python -m agent_challenge.selfdeploy review teardown --cvm-id <review-cvm-id>
python -m agent_challenge.selfdeploy eval teardown --cvm-id <eval-cvm-id>
# or legacy:
python -m agent_challenge.selfdeploy teardown --cvm-id <cvm-id>
# Confirm empty inventory via phala CLI when available:
phala cvms list # expect total: 0| Pin | Value | Source |
|---|---|---|
| Documented / product pin | x-ai/grok-4.5 |
agent-recipe DEFAULT_OPENROUTER_MODEL |
| Challenge review harness | x-ai/grok-4.5 |
agent-challenge REVIEW_MODEL |
agent-recipe info
# → default_openrouter_model: "x-ai/grok-4.5"Confirm against current agent-challenge measurement/docs before spending. agent-recipe does not override challenge-measured image pins; it mirrors the product narrative.
| Mode | Phala spend | When |
|---|---|---|
--help / unit tests / offline |
No | Always safe |
review deploy --dry-run / eval deploy --dry-run |
No | CI / rehearsal with submit id |
deploy --dry-run (legacy) |
No | Compose/cost plan only |
deploy / review deploy / eval deploy without dry-run |
Yes | Only with key + budget ≤ $20 |
agent-recipe selfdeploy-status reports phala_key_present as a boolean only
(never key material).
Production agent template (vendored template/baseagent/agent.py):
- Calls
refuse_if_gateway_residuefail-closed when Base gateway URL/token residue appears in the environment. - Scored path is OpenRouter-in-TEE only, not a Base gateway.
See docs/security.md and template/baseagent/SYNC.md.
- Hard money cap: $20 (
--money-cap-usd 20). - CPU TDX only; GPU shapes refused by selfdeploy before any Phala call.
- Prefer
tdx.small/tdx.medium. - Tear down CVMs after success and failure; do not leave residual funded inventory.
- Post-create failure paths in AC delete attributable CVMs before returning.
- Tear down CVMs after failures and successes.
- Do not paste prepare capability tokens into tickets or git.
- Prefer challenge repo docs if flags drift; this map tracks the ordered CLI.
- Never log
OPENROUTER_API_KEY,PHALA_CLOUD_API_KEY, or hotkey mnemonics.
- Challenge self-deploy (authoritative):
https://github.com/BaseIntelligence/agent-challenge/blob/main/docs/miner/self-deploy.md - Challenge TEE concepts:
https://github.com/BaseIntelligence/agent-challenge/blob/main/docs/miner/attestation-tee.md - This recipe security: ../security.md
- Miner A→Z: README.md
- Twin (PRISM / Lium): https://github.com/BaseIntelligence/prism-recipe