Awesome Cohub
中文
Playbooksintermediatecohub.bp.space-env-sandbox2 min

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

  1. Space settings → Env — add runtime environment variables the sandbox should inject.
  2. Prefer config Space for personal defaults that should follow you; project secrets stay on the project Space.
  3. Sandbox — pick spec (e.g. boost) and idle/auto-destroy policy that matches the job.
  4. Changing Mods may restart the sandbox — plan around that.
  5. 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 turn

Tools 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 .env with production tokens
  • Assuming laptop ~/.config exists in sandbox (execution-token)
  • Infinite idle on expensive specs “just in case”