When
The agent needs API keys, model endpoints, or a different sandbox size/idle policy — without baking secrets into git.
Outcome
- Secrets live in Space env / config, not in committed files
- You know sandbox settings (spec, hibernation/auto-destroy) affect cost and cold start
- Paths stay sandbox-shaped (
/workspace,/configs/*)
Steps
- Space settings → Env — add runtime environment variables the sandbox should inject.
- Prefer config Space for personal defaults that should follow you; project secrets stay on the project Space.
- Sandbox — pick spec (e.g. boost) and idle/auto-destroy policy that matches the job.
- Changing Mods may restart the sandbox — plan around that.
- Verify in a prompt:
printenv | sort(redact in logs) or a minimal script that reads only required keys.
Model context (v2.6)
Sandbox commands receive two injected variables describing the model driving the current turn:
COHUB_MODEL_PROVIDER # e.g. openai / anthropic / local
COHUB_MODEL_ID # model id of the current turnTools and scripts can branch on these to adapt output, formatting, or cost behavior without guessing.
Done when
- [ ] Required keys exist in the running sandbox
- [ ] Repo has no live secrets
- [ ] Idle policy matches whether this is a 24/7 loop or a daytime builder Space
Avoid
- Committing
.envwith production tokens - Assuming laptop
~/.configexists in sandbox (execution-token) - Infinite idle on expensive specs “just in case”