Day 9 of 990 minCipher CadetHands-on lab
Day 9: Capstone: Ship the Security Dashboard
Taught by Mr Elite Updated
By the end of today you can
- Drive a full project from spec to tested release candidate using Kiro specs, steering, a hook and MCP
- Build a dashboard with login, statistics, a mock URL analysis page and scan history
- Run a security review and a deployment checklist on AI-written code
- Choose and write down a concrete next step for your learning
Warm-up
Answer from memory first, then tap to check. Recalling yesterday is what makes it stick.
Why must a regression test fail before the fix and pass after it?
Failing first proves the test really catches the bug. Passing after proves the fix removed it.
Name two things to check when reviewing AI-written login code.
Password hashing, token expiry, reset flows, and error messages that leak information.
Eight days ago you had never opened Kiro. Today you ship something real: a small security dashboard where a user registers, logs in, sees statistics, submits a URL for analysis and reads their scan history. You will not write it alone. You will direct an agent, and the way you direct it is what matters.
This is the day you put every habit together. Spec first, rules in steering, a hook for repeated work, MCP kept on a short lead, and a security review before anyone calls it done. The URL analysis is a mock, so nothing touches a real website. Everything runs on your own machine.
The plan: spec first, then rules, then build
A capstone fails when you type 'build me a dashboard' and hope. We do the opposite. First we write down what the dashboard must do, then we fix the rules the agent must follow, then we let it build in small tasks that you review one at a time.
Here is the order for the next 90 minutes. Spec, 15 minutes. Steering and hook, 10 minutes. Build, 35 minutes. Security review and lab, 20 minutes. README and checklist, 10 minutes. Keep a rough eye on the clock, because the build is where time quietly disappears.
Before we start, check your tools. You need Kiro installed from earlier in the course, plus Node.js, npm and git. Open a terminal and run the commands below. Each should print a version number. If one says 'command not found', install it from its official website, then reopen the terminal and try again.
node --version
npm --version
git --versionWhy this order? The spec tells the agent what done looks like. Steering tells it how to behave. Small tasks let you catch a bad decision after ten lines instead of ten files. Skip any of the three and you end up reviewing a large pile of code you did not ask for.
- Release candidate
- A version you believe is ready to ship, which still has to pass its final checks.
- Mock service
- A fake stand-in that returns made-up answers, so you can build and test without touching anything real.
- Deployment checklist
- A list of things to confirm before software goes live, such as secrets, tests and logging.
- Diff
- The view of exactly which lines an agent added, changed or removed, which is what you review.
Watch me do it: spec, steering and hook
I will start a new folder, then ask Kiro for a spec. Everything here runs locally on your own machine. Open your terminal first.
mkdir secdash
cd secdash
git init
pwdBuild a security dashboard web app with Node.js and SQLite. Features: user registration and login, a statistics page showing counts of scans by verdict, a URL analysis page that calls a MOCK analysis service (no real network requests), and a scan history page per user. Include automated tests.When requirements.md appears, it should read like the lines below. Yours will differ in wording. What matters is that every feature has a trigger and a response you could test. Vague lines such as 'the system should be secure' give you nothing to check, so ask Kiro to make them specific.
WHEN a visitor submits a valid registration form, THE SYSTEM SHALL store a hashed password and create the account.
WHEN a logged-in user opens a scan history page, THE SYSTEM SHALL show only that user's scans.
WHEN a user submits a URL, THE SYSTEM SHALL return a verdict from the mock service without fetching the URL.# Security rules
- Use Node.js, Express and SQLite only.
- Hash passwords with bcrypt. Never log passwords or tokens.
- Read secrets from environment variables, never from source files.
- Use parameterised queries for every database call.
- The URL analyser must never fetch the submitted URL.
- Every route that shows user data must check the logged-in user.A word on the hook. It fires every time you save a matching file, so a vague instruction would let the agent wander across your project. That is why ours names one job, tests for the changed file, and forbids shell commands. Narrow instructions are the hook equivalent of least privilege.
Quick check
Why do we put 'use parameterised queries' in a steering file instead of repeating it in each prompt?
Steering is persistent context the agent reads each time, which removes reliance on you remembering.
Build task by task and review every change
Now we run tasks. Open tasks.md and click Start next to the first task only. After each one, stop and read the diff before accepting. This is the review habit from Day 4 and Day 8.
Here is what a diff review looks for in practice. The first snippet builds a database query by gluing user input into the text, which is how injection happens. The second uses a placeholder, so the input is always treated as data. If you ever see the first style, reject it and point the agent at your steering rule.
// Reject this: input is joined into the query
db.get("SELECT * FROM users WHERE email = '" + email + "'");
// Accept this: placeholder keeps input as data
db.get('SELECT * FROM users WHERE email = ?', [email]);npm testgit add -A
git commit -m "Auth and tests passing"For MCP, use what you set up on Day 7 only if it helps, for example a filesystem or documentation server limited to this folder. Give it the least access that works. If you skipped it, note that in your README and say why.
Finally, run the app yourself. Ask Kiro for the start command if it has not told you, usually npm start, then open the address it prints, such as http://localhost:3000. Register, log in and submit a test URL. Seeing it work by hand catches problems that tests miss, such as a page that loads blank.
Security review before release
Passing tests do not prove safety. Before calling this a release candidate, go through this list against your own code, and ask Kiro to help you find each item rather than assume. Everything here is done against your own local app.
npm audit
git grep -i -n "secret\|password\|apikey"Expect npm audit to end with a line like 'found 0 vulnerabilities', or a list with severities. The git grep output will include harmless hits such as variable names. You are looking for a real value assigned in the source, for example a long string next to the word secret.
Quick check
All your tests pass. What does that tell you about security?
Tests cover what you thought to test. Security flaws usually live in what nobody tested.
Lab: decide what an agent may do alone
Your dashboard was built by an agent that kept asking permission. The lab flips this: an office assistant agent runs eight actions with no approval. You decide which need a human first, without gating everything. Open it from your SecurityElites account before the mission.
Sign in to SecurityElites, find the lab named ai-review-agent-approvals-1 in your labs list, and start it. Give yourself about ten minutes. Work through the hints in the lab panel below. Your aim is a sensible policy with a reason for each choice, not a perfect score on the first attempt, so change your mind if your reasoning shifts.
Deployment checklist and what to learn next
Create a file called DEPLOY.md and tick each item honestly. If one fails, the project is a release candidate, not a release.
# Deployment checklist
- [ ] npm test passes
- [ ] npm audit reviewed
- [ ] No secrets in the repository
- [ ] Secrets set as environment variables
- [ ] HTTPS enabled where hosted
- [ ] Debug output and stack traces off
- [ ] Login attempts rate limited
- [ ] Backup plan for the database
- [ ] Mock analyser clearly labelled as mockSome items need a reason. Stack traces off matters because error pages can reveal file paths and library versions. Rate limiting slows anyone guessing passwords. A backup plan covers the day the database file is deleted or corrupted. Labelling the mock stops a user trusting a made-up verdict as a real one.
Next, write the README. Someone who has never seen your project should be able to run it from this file alone. A good skeleton is below. Fill each heading, add your four screenshots, and finish with the single next step you are choosing.
# Security Dashboard
## What it does
## How to run it
## How to run the tests
## Security decisions
## Known limits (the analyser is a mock)
## My next stepFor next steps, pick one: learn web application security basics such as the OWASP Top 10, practise reviewing code in more SecurityElites labs, or rebuild this project with a real analysis API behind strict controls. Choose one and write it in your README.
Your turn
Who Approved That?
Today you decided when to approve the agent's actions. This lab asks the same question about an office assistant that can take eight actions and currently asks permission for none. Good judgement here is the skill that stops agents causing harm without making them useless.
What to try
What to notice
- Irreversible actions need a person more than frequent ones do
- Gating every action makes people click yes without reading
- The same action can be safe or risky depending on who or what it affects
If it did not work
Asking the agent to build the whole app in one prompt
Write the spec, then run one task at a time and review each diff before moving on.
Approving permission prompts without reading them
Stop and ask the agent to explain the command. Deny it if you still do not understand.
Treating passing tests as proof of security
Complete the manual review list: hashing, tokens, authorisation, errors, secrets.
Letting the URL analyser fetch real addresses
Keep it a mock that returns made-up verdicts and state this in the steering file.
Giving the MCP server or hook broad access
Limit it to the project folder and write the narrowest instruction that works.
Recap
- Spec first, then steering, then small reviewed tasks
- Steering files carry your security rules into every task
- Hooks and MCP add power, so give them the least access
- Passing tests do not prove the code is secure
- A deployment checklist turns a release candidate into a release only when every item is honest
- Human approval belongs on irreversible or outward-facing actions, not on everything
Cheat sheet
npm test- Runs the automated tests
npm audit- Lists known vulnerable dependencies
git commit- Saves a restore point after a reviewed task
.kiro/steering/- Folder of rules the agent follows on every task
EARS requirement- WHEN event, THE SYSTEM SHALL response
Mock service- Fake stand-in that avoids touching real systems
Before the next day
Mission: Ship and document the release candidate
Finish the dashboard, prove it works, review it for security problems, and document it so another person could run it. This is your proof that you can direct an agent safely from idea to release candidate.
About 60 min
You are done when: A repository containing the dashboard, passing tests, DEPLOY.md, and a README with screenshots and your chosen next step.
Want more? Add a second hook that reviews each saved file for the steering rules and reports any breaches, then record what it caught.
Quiz
4 questions. Your score is saved with your progress.
1. Why does the capstone use a mock URL analysis service?
A mock keeps everything local and removes the risk of the app being tricked into fetching dangerous addresses.
2. You log in as user A and open user B's history by editing the ID in the address bar, and it works. What is the flaw?
The app confirms who you are but not whether the data is yours, which is an authorisation failure.
3. Which action most deserves human approval in an assistant agent?
Sending data outside the organisation cannot be undone, so a person should confirm it.
4. What turns a release candidate into a release?
Only verified checks show readiness. Agent claims and ticked tasks do not prove it.
Finish the day
Mark the day complete to save your progress.
What next: There is no Day 10. Take your README, pick the one next step you wrote down, and start it this week, whether that is the OWASP Top 10, more SecurityElites labs, or a second project built with the same spec, steering and review habits.
Your notes
Private to this device. Write what you want to remember from today.