Skip to main content

A Grok Bot plus CLI: weak Docker agent scored 54/100; the hardened image scored 0

GitHubGitHubritvikindupuri2026-11-29

Code and reposLimitsAuthor's claim, unverifiedRead first
GitHubGitHubritvikindupuri2026-11-29

Open original

Overview

A team that runs coding or MCP agents in Docker or Kubernetes can import this Grok Bot template and install the CLI on a scan host they control, to see what a prompt-injected shell could reach.

Workflow

  1. What it is: A Grok Bot template plus a Python CLI that test what a prompt-injected AI agent's shell can reach from inside its container or pod, and back each risky finding with a harmless proof. The README presents two parts: the ShellReach Grok Bot (source under grokbot-template/) and the shellreach engine the bot calls, which also runs on its own in CI. The bot asks where agents run, audits each container or pod, explains each risk as a short attack chain with a fix, and re-checks on a schedule or when a new agent image or pod spec appears. The README does not label it a hackathon or prototype.
  2. Grok Bot parts used: One importable bot template at x.ai/bot/6JbROrRFa6BcTBF27xR5O, two skills (shellreach-getting-started and agent-sandbox-audit), memories from the first conversation, and two routines (a scheduled re-check and a re-check when a new agent image or pod spec appears). The getting-started skill says to save the owner's answers as memories (scan host or kube context, target list, watched source, schedule, alert threshold) and to create the two routines from the template after the first audits. The routine files themselves were not read. Not part of Grok Bot: the shellreach CLI (Python 3.9+ standard library plus PyYAML), the POSIX sh probe, Docker or kubectl on the scan host, and the CI gate. The README says the bot's first conversation can also offer to install the engine.
  3. You need: A Grok Bot that can import the template, plus a machine the bot can use that has Docker or kubectl access to the agent sandboxes you are authorized to test. The engine is installed with pipx from the GitHub URL, or with pip install . from a clone, then checked with shellreach --version. Each live target needs /bin/sh inside the image. Distroless images need a debug container, or you use shellreach spec on the manifest instead. Not stated in the source: which Grok Bot paid plan is required.
  4. Install: Import the bot template, then install the engine on the scan host.
    • Step 1: Import the ShellReach bot template from https://x.ai/bot/6JbROrRFa6BcTBF27xR5O . The README says the template source is also in grokbot-template/shellreach-template.json (that file was not extracted as a separate block).
    • Step 2: In the first conversation, the getting-started skill asks, one at a time, where the agents run (a registered Docker machine, a Kubernetes context or namespace, or CI only; default: one Docker host), which containers, pods or images are agents (and confirmation that you own them and are authorized to test them), where new images or pod specs come from (default: nothing to watch), and how often to re-check and what should wake you (default: daily at 8:00 in your timezone, alert only on new or worse findings at HIGH or above).
    • Step 3: If the engine is missing on the scan host, install it with pipx install git+https://github.com/ritvikindupuri/ShellReach (or pip install --user from a clone) and check shellreach --version.
    • Step 4: The skill then runs agent-sandbox-audit on every named target and tells the bot to save each report as that target's baseline.json only after the owner has seen it and says it is accepted, then to create the two routines using the owner's schedule and threshold.
  5. After install: A chat question, the daily routine, or a new watched image or pod spec starts an audit; the bot picks a mode and the engine runs harmless tests inside the sandbox, then the bot explains anything new or worse.
    • Modes include shellreach scan container NAME, shellreach scan pod NS/POD, shellreach scan image IMAGE with the agent's real --run-arg flags, shellreach spec on compose or Kubernetes files before anything runs, and shellreach probe | sh from inside the sandbox followed by shellreach analyze.
    • Each finding has a severity, a status (PROVEN, EXPOSED, or CONFIGURED), an impact path, an attack chain, the proof, and a fix. The headline is a reach score from 0 to 100 (10 per critical, 5 per high, 2 per medium, 1 per low) and open impact paths out of 6.
    • The bot is instructed to apply a fix only when the owner asks for that specific change, then re-scan and show the diff. Secret values are never shown.
  6. Did the author run it: The repository includes example scan reports from 2026-11-28, marked here as the author's claim, not reproduced. In examples/docker-weak/shellreach.md, a container named sr-weak-agent (image shellreach-demo-agent:0.1) scored 54/100, with 5 of 6 impact paths open and 10 findings, all proven: 2 CRITICAL, 6 HIGH, 2 MEDIUM, scanned at 2026-11-28T20:55:22Z (2026-11-29 04:55 Asia/Taipei) with ShellReach 0.1.0. The two critical items were a container runtime socket at /run/docker.sock and cloud credentials readable from the environment. In examples/docker-hardened/shellreach.md, sr-hardened-agent scored 0/100 with 0 findings about one second later. examples/docker-diff.txt lists those 10 findings as RESOLVED (score 54 to 0). In Kubernetes, examples/k8s-weak/shellreach.md scored 50/100, with 3 of 6 paths open and 11 proven findings (2 CRITICAL, 4 HIGH, 5 MEDIUM) at 2026-11-28T20:55:58Z (2026-11-29 04:55 Asia/Taipei); the two critical items were that the pod's service account can exec into other pods and can read Secrets. examples/k8s-hardened/shellreach.md scored 0/100 at 2026-11-28T20:56:32Z (2026-11-29 04:56 Asia/Taipei), and examples/k8s-diff.txt lists all 11 as RESOLVED (score 50 to 0). A spec-only check of a weak compose or manifest in examples/spec-weak/shellreach.md scored 34/100 with 10 CONFIGURED findings and 0 proven; the hardened spec scored 0/100. The README also points to docs/DEMO-REPORT.md and a 110-second demo recording; those were not read here. The README says the cloud metadata check ran in unit tests only, because the demo host does not expose a metadata service.

Key points and results

  • Maturity: At fetch time on 2026-11-29 the repo was created 2026-11-28T21:06:33Z, last pushed 2026-11-28T21:40:09Z, with 4 commits, 0 stars, 0 forks, 0 open issues or PRs, and an MIT license. It ships a Grok Bot template link (x.ai/bot/6JbROrRFa6BcTBF27xR5O). The README mentions pytest with 32 tests, including a BusyBox run in Alpine; those test files were listed but not extracted as report blocks.
  • Permissions and boundaries: The bot and README restrict scans to targets the owner owns or is authorized to test, and they tell the engine never to run the attack a finding describes. Proofs are limited to acts such as a canary file written and removed, a read-only GET /version on a Docker socket, a cloud metadata request for the identity path only, a Kubernetes pod create with dryRun=All, and one HEAD request to a public site. Secret values never leave the sandbox; the tool reports names, lengths and a type such as openai. The getting-started skill says the bot does not change containers or the cluster unless the owner asks for a specific fix.
  • Known limits: ShellReach shows what a shell can reach, not whether the agent can be injected; it assumes injection succeeds. The probe needs /bin/sh. Runtime sockets other than Docker and Podman speak gRPC and are reported as EXPOSED, not PROVEN. SelfSubjectRulesReview is namespace-scoped and may be incomplete with webhook authorizers. Secret detection uses names and known prefixes, so a secret under an innocent name with no known prefix is missed. Egress is tested against one endpoint; an allowlisting proxy that allows that endpoint will read as open. The cloud metadata check in the demo ran in unit tests only.
  • Worth borrowing: Back every risky finding with a named harmless proof, and report secret names and lengths rather than values. From the Harmless proofs section of the README and the checks table.
  • Worth borrowing: Diff new scans against an owner-accepted baseline and alert only on new or worse findings at a chosen severity. From the Key Features section of the README and grokbot-template/skills/shellreach-getting-started/SKILL.md.
  • Worth borrowing: Grade a secret one level lower when egress is blocked, with a note that the agent's own replies can still leak it. From the Key Features section of the README.

Source

Platform
GitHub
Author
ritvikindupuri
Published
Categories
Code and repos, Limits

What this evidence label means

Author's claim, unverified

The method and results come from the author's own account. This site has not reproduced them.

Read the editorial and evidence policy

Other cases in this scenario

This unofficial community project is independent of xAI. xAI has neither approved nor endorsed it. No sign-up. The methods and figures come from the original authors.