Every MCP tool call runs as you, scoped to the team you selected at sign-in. Updating control status or evidence writes to your live workspace — ask the agent to show a plan and sample evidence text before it calls
update-control.What “done” looks like
Treat this as the acceptance criteria for the whole program of work (swapAppSec for any use-case framework):
That last row matters as much as the first three. Auditors and future you need a dated disposition for deferred and out-of-scope controls, not an empty status.
Before you start
1
Connect the MCP server
Follow Keldyn MCP server and sign in to the team that owns the use case.
2
Assign the framework on the use case
Open the use case → Add Framework → enable AppSec (or ISO 27001, CASA, etc.). Controls only appear after the framework is assigned and scoped. See Frameworks & controls.
3
Open the repository
Run the agent from the repo that implements the system so it can read code, add tests, and cite real paths in evidence.
4
Know your scope
Have the use case ID ready (
list-use-cases if you don’t). Org-level and use-case tracking are separate — pass useCaseId on every update-control call when you mean the use case.5
Know (or load) the architecture
Prefer reading the use case’s saved architecture via MCP (
get-use-case) before inventing hosting assumptions. If deployment, trust boundaries, or runtime topology still aren’t clear, ask the user — don’t guess.The loop at a glance
1. Load architecture (ask when unclear)
Before inventorying controls, ground the agent in how the system actually runs.Many AppSec dispositions (especially N/A vs defer for edge, network, and platform controls) depend on deployment. Prefer the use case architecture in Keldyn; only interview the user for what that model does not cover.
2. Inventory the controls
Pull the framework’s controls for the use case, then fetch full requirements. Flag which ones are code-relevant (those are the only ones that need unit/integration tests).list-controls with frameworks: ["appsec"] scopes to AppSec. Use slug appsec (or the framework name); other common slugs include casa, iso-27001, soc2, gdpr. relevance: "code" is useful when you want only the subset that should get unit/integration tests.
3. Triage before you write code
Ask the agent to bucket every control before it edits the repo or callsupdate-control:
4. Implement and add tests (code-relevant only)
Work control-by-control (or by theme: auth, input validation, secrets, headers, dependencies). For each code-relevant control in implement-now / already-satisfied:- Implement or confirm the control in the platform code.
- Add or identify a unit or integration test that fails if the control stops holding (not a vague smoke test — assert the security property).
- Run that test locally before updating Keldyn.
What a good guardrail test looks like
Prefer unit or fast integration tests that run in the package’s default
npm test / CI job. E2E alone is not the bar for this guide — reserve E2E for flows that truly can’t be asserted lower down.
5. Write evidence that points at code and tests
Once a code-relevant control’s test is green, update the use-case control withupdate-control:
Evidence text template (code-relevant)
Paste this shape into prompts so every code-relevant control gets consistent, auditor-friendly notes:Test: line and describe how the control is satisfied (policy link, hosting config, integration evidence, etc.).
6. List what you did not implement
For every control left open, record a dated disposition. Silenttodo is the enemy.
Gap list format (keep in the PR / ticket / evidence)
- Not applicable →
update-controlwithstatus: "ignored"and the reason + date inevidenceText(and optionallyfinding). - Defer →
status: "in_progress", same reason + target date inevidenceText, pluscreate-taskwithrcmIdso the gap is actionable.
End-to-end prompts (copy and adapt)
A. Full AppSec pass (recommended starter)
Improved version of a typical “implement + maintain AppSec with tests” request:B. Evidence-only refresh (code already good)
C. Single control deep-dive
D. Gap inventory only (no code changes)
Tips that keep evidence trustworthy
- Tests only where code owns the control — if the control isn’t enforced in this repo, don’t add a fake unit test; record N/A, defer, or non-test evidence instead.
- One control, one guarding assertion — a shared “security smoke” test that vaguely touches ten controls is weak evidence; prefer a named test per control or a clearly commented assertion block.
- Ask when architecture is ambiguous — load the use case architecture first; only ask the user about deployment/topology for what you still can’t infer.
- CI is part of the story — put code-relevant tests in the default pipeline. Mention the job or command in the
Verified:line. - Re-evidence when paths move — refactors that rename files should refresh
evidenceTextin the same PR. - Don’t over-claim — edge/WAF/cloud-config controls usually can’t be unit-tested in-app; defer or N/A with a date, or point at infra / integration evidence instead.
- Related loop — for a broader “find gaps → tasks → fix” workflow without the test bar, see From controls to code with MCP.
Next steps
Controls-to-code workflow
Broader loop: analyze the repo, mark controls complete, and open tasks for gaps.
Keldyn MCP server
Connect your AI tool and see tools plus built-in prompts like collect-evidence.
Evidence & audits
Attach files, links, and integration-collected evidence in the web app.
Frameworks & controls
Assign AppSec (and other frameworks) and track status in the workspace.