Govern agents, MCP and secrets
Make the safe path the easy path: approved servers, pinned versions, masked secrets and the right control at the right layer.
- Four layers of control
- Product behaviour you can't switch off, org or enterprise policy, repository settings, and workspace config on each developer's machine. Knowing which layer owns a control tells you who can change it.
- MCP intake
- Publisher, pinned version, transport, tools exposed, data in and out, credentials and an owner. @latest means you're running code nobody reviewed.
- Secrets in config
- Use ${input:id} with password: true, or ${env:NAME}. A literal key in .vscode/mcp.json gets committed sooner or later.
- Honest metrics
- Usage metrics show adoption, not correctness or time saved. Pair each number with the decision it informs and what it can't tell you.
Worked example: Fixing the team's mcp.json
One server runs @latest; another is unapproved and has a literal API key.
Before
"issue-tracker": {
"command": "npx",
"args": ["-y", "acme-tracker-mcp"],
"env": { "TRACKER_API_KEY": "lab-fixture-fake-…" }
}After
"inputs": [{ "type": "promptString", "id": "tracker-api-key",
"description": "Acme Tracker API key (read-only)", "password": true }],
"issue-tracker": {
"type": "stdio",
"command": "npx",
"args": ["-y", "acme-tracker-mcp@2.3.1"],
"env": { "TRACKER_API_KEY": "${input:tracker-api-key}" }
}Why it works: The version matches the intake review, the key is masked and stored by VS Code instead of committed, and the server has a named owner in approved-servers.json.
One click, two incidents
Lab setup
Folder: governance/ in the labs download.
- Node.js 22+ only. The lab never starts an MCP server or calls the network.
cd governance && git init -q && git add -A && git commit -qm baseline
npm run verify # expect 4 FAILWhen you're done, npm run verify prints:
PASS 1. MCP servers approved, pinned, no inline credentials
PASS 2. No secret-looking values in the repository
PASS 3. Every control mapped to the right layer
PASS 4. Playbook, threat model, intake, tabletop, metrics completeReview rubric
Score each line 0 (missing), 1 (partly there) or 2 (as described). Passing verify is necessary, not sufficient.
| Criterion | 2 points means |
|---|---|
| Intake | Every question answered with a specific, checkable fact |
| Configuration | Pinned versions, masked inputs, no literals |
| Layers | Can explain who owns each control and how to change it |
| Threat model | Each threat has a concrete mitigation and a named owner |
| Response | Tabletop answers ordered, time-bound and include rotation |
| Measurement | Metrics tied to decisions, with stated limits |
Safety note
The fake credential in the starter is deliberately obvious. Never paste a real key into a lab. In real repositories, turn on GitHub secret scanning and push protection.
Lab repository and walkthrough
The governance/ practice repository with npm run verify, a reference solution, and a step-by-step walkthrough.
- Checkers for MCP config, secrets, policy layers and docs
- Intake form, threat model, playbook and tabletop exercise
- Reference answers with reasoning
One payment, lifetime access. $29 $19 launch price.
Try it yourself· about 90 min
Bring the team's MCP config under control, then write the governance documents.
- Complete docs/mcp-intake.md and approve or remove the tracker server.
- Pin versions and move the key to a masked input; run check:mcp and check:secrets.
- Map each control in policy-map.json to its layer and run check:policy.
- Fill in the playbook, threat model, tabletop and metrics plan.
You should see: npm run verify prints four PASS lines.
Knowledge check
Get every answer right to complete this module. Progress is saved in this browser only.