google/capsem/dev-capsem-doctor
Claude Code and agent skill by google/capsem
- vendor
Checking that the SKILL.md file is still in the repository.
The capsem-doctor in-VM diagnostic suite. Use when writing, running, or extending doctor tests, or debugging VM sandbox issues.
Install
npx vskill@latest install google/capsem/dev-capsem-doctorSKILL.md
The same SKILL.md was published earlier as google/capsem/dev-capsem-doctor.
capsem-doctor
capsem-doctor is a pytest-based diagnostic suite that runs inside the guest VM. It verifies sandbox integrity, network isolation, runtime environment, and AI agent functionality. It's the smoke test gate -- every change must pass it before shipping.
Doctor is also an Ironbank input. When doctor is used to close a release-critical VM/security/protocol/package-manager gate, load /ironbank and assert the full ledger through tests/ironbank/: client result, DB rows, structured logs, UDS/HTTP route output, counters, and UI-facing JSON. A doctor exit code or "row exists" check is not enough.
Running
Test categories
| File | What it validates | |
|---|---|---|
test_sandbox.py | Read-only rootfs, binary permissions (chmod 555), no setuid/setgid, kernel hardening (no modules, no debugfs, no IPv6, no swap, no kallsyms), process integrity (pty-agent, dnsmasq running; no systemd, sshd, cron), network isolation (dummy0, fake DNS, iptables, no real NICs) | |
test_network.py | MITM CA in system store, curl without -k works, Python urllib HTTPS, CA env vars set (SSL_CERT_FILE, REQUESTS_CA_BUNDLE, NODE_EXTRA_CA_CERTS), HTTP/80 blocked, non-443 ports blocked, direct IP blocked, multi-domain DNS faking, AI provider domains reachable | |
test_environment.py | TERM/HOME/PATH env vars correct, shell is bash, kernel version, aarch64 arch, mount points (/proc, /sys, /dev, /dev/pts), tmpfs verification | |
test_runtimes.py | python3/pip3 versions; hermetic pip install into the venv; hermetic apt install of a local .deb; apt sandbox TLS trust; Python file I/O | |
test_workflows.py | Text write/read, Python JSON roundtrip, shell pipes, large file (10MB) | |
test_virtiofs.py | VirtioFS root mount, ext4 loopback upper, loop device active, workspace write/read/large file/subdir, system overlay writable, pip install works, file delete+recreate (skipped in block mode) | |
test_mcp.py | Guest MCP endpoint tool routing, domain blocking via MCP | |
test_injection.py | Security injection tests | |
test_lifecycle.py | capsem-sysutil lifecycle symlinks, read-only sysutil, VM identity env vars, hostname | |
test_storage_write_probes.py | Bounded create/read/delete probes on package-manager and workspace paths, _apt partial cache | |
conftest.py | Test infrastructure (auto-skip outside VM, output dir fixture); run() lives in diagnostic_support.py |
The runtime rootfs is minimal (Debian base plus runc, umoci, python3, iptables, iproute2, curl, procps, pytest, rich, venv). Tests may only use those: node, uv, git, AI CLIs and pip packages like certifi or fastmcp live in the OCI images under images/, proven by tests/images/.
Infrastructure (conftest.py)
Adding a new test
- Add test functions to the appropriate
guest/artifacts/diagnostics/test_*.pyfile, or createtest_<category>.py - Use
from conftest import runfor shell commands,output_dirfixture for temp files - Tests auto-skip outside the capsem VM (no special guards needed)
just exec "capsem-doctor"picks up changes immediately (diagnostics repacked into initrd)- For rootfs-baked changes:
just _build-assetsthenjust exec "capsem-doctor"
Where tests live on disk
- Source:
guest/artifacts/diagnostics/test_*.py(in the repo) - In rootfs:
/usr/local/lib/capsem-tests/test_*.py(baked by Dockerfile.rootfs) - In initrd: overrides rootfs copies via
_pack-initrd(fast iteration)
Writing good diagnostic tests
- Test one thing per function. Name clearly:
test_readonly_rootfs,test_mitm_ca_in_system_bundle - Use
run()for shell commands, check.returncodeand.stdout/.stderr - Set reasonable timeouts (default 10s). Network tests may need longer.
- Think adversarially: test what should be blocked, not just what should work
- For VirtioFS tests, skip gracefully in block mode:
pytest.mark.skipif - For Ironbank/release gates, do not skip. If a package manager, protocol, or
diagnostic dependency is unavailable, the product or harness is broken.
- Package-manager diagnostics must prove function, not installation presence:
run the installed binary/module and verify deterministic behavior.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 25 Oct 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/dev-capsem-doctor/SKILL.md
Popularity
- Repository stars
- 58
- Repository forks
- 8
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 21 Jun 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/google/capsem/dev-capsem-doctor)