Skip to main content
Glama

exec_with_secrets

Destructive

Run a child shell command with project secrets injected as environment variables, automatically redacting leaked values from stdout and stderr so credentials never appear in chat.

Instructions

[exec] Run a child shell command with project secrets injected as environment variables and any leaked secret values redacted from captured stdout/stderr before they return to the agent. Use to let an agent run a script that needs credentials (npm run db:migrate, terraform plan, vercel deploy) without ever putting plaintext values in the chat; prefer env_generate if you need to write a .env file to disk and validate_secret for upstream liveness checks. Spawns a real child process — has whatever side effects the command itself causes (writes, network, exec). Subject to BOTH tool policy and exec policy (allowlist/denylist). Returns a text body with Exit code: N then STDOUT: and STDERR: blocks; both streams are scrubbed against the secret values that were injected (verbatim; base64/hex/URL/JSON-encoded for values up to 256 chars; 16+ char slices of each credential part, skipping credential parts longer than 1024 chars, where a whole opaque value counts as one part). A scrubbed value reads [QRING:REDACTED:<KEY_NAME>], naming the keyring key it came from. Which secrets are injected: when the project's .q-ring.json declares a secrets manifest, only the declared keys (intersected with keys); without one, only credential-shaped names (…_KEY, …_TOKEN, …_SECRET, …_PASSWORD, …_URL, …DSN, ...), and the result ends with a NOTE naming the skipped keys. On every path, keys named like process-control variables (NODE_OPTIONS, LD_PRELOAD, GIT*, MAVEN_OPTS, ...) or that are not plain identifiers are never injected.

Input Schema

NameRequiredDescriptionDefault
argsNoPositional arguments passed to `command`. Example: ['run', 'db:migrate']. Each element is passed verbatim with no extra shell parsing.
keysNoWhitelist of exact key names to inject. Omit to inject every allowed secret (the manifest's keys when the project declares one, else the credential-shaped names in scope; subject to `tags`).
tagsNoInject only secrets carrying at least one of these tags. Combinable with `keys` as an AND filter.
orgIdNoOrganization identifier for org-scoped secrets. Required only when scope='org'. Example: 'acme-corp'.
scopeNoWhere the secret lives. 'global' = user keyring (default if omitted on reads), 'project' = scoped to projectPath, 'team' = team-shared (needs teamId), 'org' = org-shared (needs orgId).
teamIdNoTeam identifier for team-scoped secrets. Required only when scope='team'. Example: 'acme-platform'.
commandYesExecutable name or full command to run. Example: 'pnpm', 'node', '/usr/bin/env'. Must be allowed by exec policy.
profileNoExec sandbox profile. 'restricted' (default) denies network-tool binaries (curl, wget, ssh, scp, nc, netcat, ncat) AND common interpreters/shells (python, node, deno, bun, perl, ruby, php, sh, bash, zsh) — since those could otherwise egress the injected secrets — strips proxy env vars, and caps runtime at 30s. It still is NOT a real OS sandbox (it does not restrict PATH, and some allowed binary could in principle make network calls); for genuinely untrusted commands use OS-level isolation (containers, network namespaces). 'ci' allows network and interpreters with a 300s cap and blocks a few destructive commands; 'unrestricted' inherits the full server environment. Define a custom profile in .q-ring.json to allow specific interpreters with secrets.restricted
projectPathNoAbsolute path to the project root for project-scoped secrets and policy resolution. Defaults to the MCP server's current working directory when omitted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.19.0
    • changedInput schema / properties / keys / description
      Previous value: -"Whitelist of exact key names to inject. Omit to inject every secret in scope (subject to `tags`)."New value: +"Whitelist of exact key names to inject. Omit to inject every allowed secret (the manifest's keys when the project declares one, else the credential-shaped names in scope; subject to `tags`)."
  2. Changed1 schema field changedv0.14.1
    • changedInput schema / properties / profile / description
      Previous value: -"Exec sandbox profile. 'restricted' (default) limits PATH and inheritable env vars; 'ci' is restricted plus CI-friendly defaults (no TTY); 'unrestricted' inherits the full server environment — only pick this when you understand the leak risk."New value: +"Exec sandbox profile. 'restricted' (default) denies network-tool binaries (curl, wget, ssh, scp, nc, netcat, ncat) AND common interpreters/shells (python, node, deno, bun, perl, ruby, php, sh, bash, zsh) — since those could otherwise egress the injected secrets — strips proxy env vars, and caps runtime at 30s. It still is NOT a real OS sandbox (it does not restrict PATH, and some allowed binary could in principle make network calls); for genuinely untrusted commands use OS-level isolation (containers, network namespaces). 'ci' allows network and interpreters with a 300s cap and blocks a few destructive commands; 'unrestricted' inherits the full server environment. Define a custom profile in .q-ring.json to allow specific interpreters with secrets."
  3. Changed9 schema fields changedv0.11.7
    • changedInput schema / properties / args / description
      Previous value: -"Command arguments"New value: +"Positional arguments passed to `command`. Example: ['run', 'db:migrate']. Each element is passed verbatim with no extra shell parsing."
    • changedInput schema / properties / command / description
      Previous value: -"Command to run"New value: +"Executable name or full command to run. Example: 'pnpm', 'node', '/usr/bin/env'. Must be allowed by exec policy."
    • changedInput schema / properties / keys / description
      Previous value: -"Only inject these specific keys"New value: +"Whitelist of exact key names to inject. Omit to inject every secret in scope (subject to `tags`)."
    • changedInput schema / properties / orgId / description
      Previous value: -"Org identifier for org-scoped secrets"New value: +"Organization identifier for org-scoped secrets. Required only when scope='org'. Example: 'acme-corp'."
    • changedInput schema / properties / profile / description
      Previous value: -"Exec profile: unrestricted, restricted, or ci"New value: +"Exec sandbox profile. 'restricted' (default) limits PATH and inheritable env vars; 'ci' is restricted plus CI-friendly defaults (no TTY); 'unrestricted' inherits the full server environment — only pick this when you understand the leak risk."
    • changedInput schema / properties / projectPath / description
      Previous value: -"Project root path for project-scoped secrets"New value: +"Absolute path to the project root for project-scoped secrets and policy resolution. Defaults to the MCP server's current working directory when omitted."
    • changedInput schema / properties / scope / description
      Previous value: -"Scope: global, project, team, or org"New value: +"Where the secret lives. 'global' = user keyring (default if omitted on reads), 'project' = scoped to projectPath, 'team' = team-shared (needs teamId), 'org' = org-shared (needs orgId)."
    • changedInput schema / properties / tags / description
      Previous value: -"Only inject secrets with these tags"New value: +"Inject only secrets carrying at least one of these tags. Combinable with `keys` as an AND filter."
    • changedInput schema / properties / teamId / description
      Previous value: -"Team identifier for team-scoped secrets"New value: +"Team identifier for team-scoped secrets. Required only when scope='team'. Example: 'acme-platform'."
  4. Addedv0.11.5

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already flag destructive/openWorld, but the description adds substantial context: it spawns a real child process with whatever side effects the command causes, is gated by both tool policy and exec policy, describes the scrub mechanism and redaction marker format, and specifies which keys are injected or skipped. It even discloses the restricted profile's limitations as a non-OS sandbox.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and key routing to siblings are front-loaded, and nearly every sentence carries substantive information. The scrubbing paragraph (base64/hex/URL/JSON encoding, 16+ char slices, 1024-char skip rule) is dense and could be compressed without losing agent-relevant meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, open-world exec tool with no output schema, the description covers side effects, policy gating, injection selection rules, and the exact return body format (Exit code, STDOUT/STDERR blocks, redaction marker). Nothing an agent needs to call it safely is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description adds meaning not in the schema: manifest-driven selection vs credential-shaped name heuristics, the intersection with `keys`, the trailing NOTE listing skipped keys, and the never-injected process-control variables. These are genuinely useful semantics beyond the field docs, though profile and scope details largely restate the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource — running a child shell command with project secrets injected as env vars and scrubbed from output — and immediately differentiates itself from env_generate and validate_secret by name. An agent can tell exactly what this does without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives both when-to-use (run a script needing credentials like `npm run db:migrate` or `terraform plan` without plaintext in chat) and explicit alternatives with the condition that selects them (env_generate for writing a .env file, validate_secret for liveness checks).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.