gum-code

A command that runs a Risor v2 script inside the gum sandbox. Risor is a scripting language, while the sandbox is a restricted environment with catalog search, catalog operations, approved web requests, and controlled parallel calls.

In plain words
What is it for?
Use it to run inline or file-based Risor scripts, search the catalog, call catalog operations, make approved HTTPS requests, print results, or run independent calls concurrently.
Why use it?
It lets scripts work with catalog data without direct filesystem, process, or unrestricted network access, while requiring confirmation before destructive operations.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/ehmo/gum/gum-code
Clone the repo
git clone --depth 1 https://github.com/ehmo/gum
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 605 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00605
Opus 5 $0.00000 $0.00302
Sonnet 5 $0.00000 $0.00121
Haiku 4.5 $0.00000 $0.00060

Measured yesterday against content hash c7607f3deb80, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gum-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/gum-code.md · 60 lines

How it starts

The opening of the file, as written. The whole thing — 60 lines — stays where its author put it; the contents beside it link to each section on GitHub.

gum code

Generated from gum schema --json. Do not edit this page by hand; run make docs-commands.

Run a Risor v2 script in the gum sandbox.

The sandbox is deliberately small: there is NO filesystem, os/exec, or raw network access, and Risor v2 has NO for/while/loop keyword; iterate with the stdlib instead (range(), list().each(), .map()).

Catalog access is provided through these injected builtins:

gum_call(op_id, args) Invoke a catalog op; returns its result. Destructive ops require a prior gum_confirm_destructive + --allow-destructive. gum_search(query) BM25-search the catalog; returns a list. gum_confirm_destructive(op_id, key) Arm a one-shot destructive confirmation. gum_parallel(calls) Fan out a list of {op_id, args} concurrently. gum_print(value) Emit a value to the response body. gum_http_get(url) HTTPS GET to an allowlisted host.

Scripts may be passed inline or as @path/to/file.risor.

Usage

gum code <script-or-@file> [flags]

Parent

Arguments

Name Help
script-or-@file

Flags

Flag Type Default Help
--allow-destructive bool false Authorise destructive sandbox ops
--allow-write bool false Authorise sandbox writes
--confirmed bool false Set the signed-confirmation flag for elevated sandbox ops
--format string Output format (toon|json|raw)
--language string risor Sandbox language (only risor in v0.1.0)
-o--output string Output format: json|toon|raw (raw script output remains raw)
--timeout-sec int 0 Per-invocation timeout in seconds (0=default)
--token string Confirmation token returned by a prior elevated gum code attempt
--log-format string json Log format: json|text
--log-level string info Log level: debug|info|warn|error (overrides GUM_LOG_LEVEL)
--profile string default Profile name to read/write config under

Read the full file on GitHub · 60 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 60 lines · 0 tokens per session scan A c7607f3deb80

Subscribe to this mod's changes

gum-code is a command published in the GitHub repository ehmo/gum (31 stars, last pushed 24d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 605 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.