Library
REF 13 Cheat Sheet · Reference

Variable interpolation

Two interpolation syntaxes. [[ Instruqt-Var ]] reads from the agent variable store. ${_SANDBOX_ID} is shell-style, scoped to specific config fields. They overlap a little; the field-coverage table shows where each works.

[[ Instruqt-Var ]] Agent store

Reads any key set by agent variable set or auto-injected. Resolved before the field is parsed — no escaping needed inside backticks.

Both attributes required. key is the variable name. hostname is the host whose store holds it (any container or VM declared in config.yml).

[[ Instruqt-Var key="DB_URL" hostname="workstation" ]]
${_SANDBOX_ID} Shell-style

Resolves the per-play sandbox identifier. Looks like a shell variable but is interpreted by Instruqt's renderer in specific config fields, not by bash.

The only built-in shell-style variable. Other shell vars ($INSTRUQT_USER_NAME etc.) are not resolved this way — they're available to lifecycle scripts but not to config-field interpolation.

https://app.${_SANDBOX_ID} .instruqt.io https://app-8080-${_SANDBOX_ID} .env.play.instruqt.com
Field coverage Where each interpolation works
Field [[ Instruqt-Var ]] ${_SANDBOX_ID} Notes
assignment.md body Including inside fenced code blocks.
assignment.md frontmatter teaser, description, button labels.
tab cmd: / path: / workdir: Resolved at tab open.
tab url: (website type) Both syntaxes accepted.
virtualbrowsers url: Shell-style only.
notes: contents (text/video/image) Plus inline <style> for per-slide CSS.
image alt-text, button labels Within body.
Markdown table cells Useful for credentials tables.
Lifecycle scripts (bash) Use shell-style here; $_SANDBOX_ID is just a regular env var. [[ Instruqt-Var ]] would not be resolved.
Common idioms
# Surface a runtime URL in the body [[ Instruqt-Var key="LLM_KEY" hostname="kubernetes-vm" ]] # Sandbox-public URL — works in virtualbrowsers AND tab url: url: https://app-8080-${_SANDBOX_ID}.env.play.instruqt.com # Bridge _SANDBOX_ID into the body (it isn't in the agent store) # In track_scripts/setup-workstation: agent variable set SANDBOX_ID "$_SANDBOX_ID" # In assignment.md: URL: `https://app.[[ Instruqt-Var key="SANDBOX_ID" hostname="workstation" ]].instruqt.io` # Auto-injected cloud creds appear in the body without any bridge Account: [[ Instruqt-Var key="INSTRUQT_AWS_ACCOUNT_LAB_ACCOUNT_ID" hostname="cloud-client" ]]
Notes