Day 5 of 760 minCipher CadetHands-on lab

Day 5: Using AI to Sort and Summarise Your Findings

Taught by Mr Elite Updated

By the end of today you can

  • Explain what an AI model does well and badly when summarising recon data
  • Write a prompt with a role, a task and an output format
  • Redact secrets before anything is pasted into an AI chat
  • Mark every claim in an AI answer as confirmed or wrong against your raw files

Warm-up

Answer from memory first, then tap to check. Recalling yesterday is what makes it stick.

Why does clean.py read from the raw folder and write to the clean folder, never the other way round?

So the original evidence is never changed, and you can always compare the cleaned data back to it.

How should a missing value be stored in findings.json?

As null, not as a guess or an invented value.

You now have a tidy findings.json. It might hold thirty or forty entries: pages, status codes, headers, server names. You could read every line yourself, but there is a faster first pass. An AI assistant can sort that list and write a short summary in seconds.

The catch is that the AI will sound confident whether it is right or wrong. Today I show you how to ask well, what never to paste, and how to check every sentence it gives back. The checking is the real skill.

What an AI is good and bad at here

An AI model is a program trained on huge amounts of text. It predicts likely words, one after another. It does not run your commands or look at your target. It only sees what you paste into the chat, and nothing else about your machine or your network.

That makes it good at some jobs: grouping similar items, putting things in an order, and turning a pile of fields into plain sentences. It is bad at others: knowing what is true about your system, counting precisely, and admitting when it does not know. It may invent a header that is not in your file, or miscount entries.

Here is a typical failure. Your file has 34 entries and the AI says 'there are 40 pages, most of them returning 200'. It sounds natural, yet both numbers may be wrong. The program is producing a believable sentence, not counting. That is why we use it for drafting and never for facts.

Hallucination
When an AI states something that sounds right but is not in your data or not true at all.
Prompt
The text you send to the AI, including your instructions and any data you paste.

Quick check

Which job is an AI model best suited to in your pipeline?

Never paste secrets or third-party data

Anything you paste into a public chatbot may be stored, logged or used for training. So before pasting, look through your data for things that must not leave your machine.

Secret
A value that grants access, such as a password, API key, token or session cookie.
Redact
Replace a sensitive value with a placeholder such as [REDACTED] before sharing it.
Third-party data
Information about systems or people that are not yours and not part of your practice target.

For this course your target is local and yours, so the risk is small. But build the habit now. Cookies in Set-Cookie headers, Authorization headers and anything that looks like a long random string are the usual culprits.

Redaction means swapping the value, not deleting the whole line. That keeps the structure readable for the AI while removing what matters. Here is the same entry before and after.

json
Before:
{"url": "http://localhost:8080/login", "status": 200, "set_cookie": "session=a8f3c91d77"}

After:
{"url": "http://localhost:8080/login", "status": 200, "set_cookie": "[REDACTED]"}
The cookie value is replaced, but the key stays, so the AI still knows a cookie was set.

Prompts with a role, a task and a format

A good prompt has three parts. The role tells the AI what viewpoint to take. The task says exactly what to do. The format says what the answer must look like. Vague prompts get vague answers.

text
Role: You are a careful junior security analyst.
Task: Below is a JSON list of findings from my own local test site.
Summarise it as the 5 most noteworthy items, ordered from most
to least important. Use only the data I give you.
Format: A numbered list. Each line: the URL, then one sentence
saying why it matters. If the data does not say, write
"not in data" instead of guessing.

DATA:
<paste findings.json here>
A prompt template. The last instruction gives the AI a safe way to say it does not know.

Notice the phrase 'Use only the data I give you'. It will not stop every invention, but it lowers the chance. The 'not in data' rule matters most, because it gives the AI an honest option other than guessing.

Compare that with a weak prompt such as 'summarise this'. The AI has to guess how long to write, what counts as important and what style you want. You will get a wall of text that is hard to check. A numbered list with one sentence per line is easy to verify, line by line.

If your file is very long and the chat refuses it, split findings_redacted.json into two halves and run the same prompt on each. Keep both answers and label them part one and part two.

Quick check

What is the purpose of the 'not in data' instruction?

How to check a claim

Checking is a method, not a feeling that something looks fine. I follow the same three moves for every line of an AI answer, and you will do the same today.

text
1. /admin returns 403 ........ confirmed (raw/admin.txt line 1)
2. /admin shows server version  wrong (Server: nginx, no version)
3. /login sets a cookie ....... confirmed (raw/login.txt line 6)
The layout I use in VERDICT.txt. One claim per line, one mark, and a pointer to the evidence.

Watch me do it

Now I run the whole loop on my own local data: redact, prompt, save, then check. Follow along with your findings.json from Day 4. I assume your project folder has raw and clean subfolders. Everything here runs on your own machine and your local target.

bash
grep -n -i -E "cookie|token|authorization|password|key" clean/findings.json
Searches your findings for words that often sit next to secrets. -n shows line numbers, -i ignores capital letters.

On my data the search printed one line, which tells me exactly where to edit. Yours will differ, but the shape should look like this.

text
14:    "set_cookie": "session=a8f3c91d77",
Example output. The number before the colon is the line to fix in the copy.

Now the important part. For each line in answer.md, I find the evidence in raw. Say the AI claims 'http://localhost:8080/admin returns 403 and reveals the server version'. I check both halves.

bash
grep -n "admin" raw/*.txt
grep -n -i "server:" raw/*.txt
Looks in your raw files for the admin path and for any Server header, so you can confirm or reject each part of the claim.

If your raw files hold only headers, the word admin may appear only in a filename. In that case run ls raw to find the admin file, then open it with cat. Here is what I saw.

text
raw/admin.txt:1:HTTP/1.1 403 Forbidden
raw/admin.txt:3:Server: nginx
raw/login.txt:3:Server: nginx
Example raw evidence. Line 1 confirms the 403. The Server header names nginx with no version number.

The 403 is confirmed, but there is no version, only the name nginx. So the second half of the claim is wrong. Half-true claims count as wrong until fixed, so I write the whole claim down as wrong and note the correction: server is nginx, version not shown.

Your turn: the lab, then your own data

Before you run your own data through an AI, practise the redaction habit in the SecurityElites lab called Secrets in the Context Window. It puts you in the position of a developer about to paste something risky into a chatbot. Do the lab first, then go back to your own findings.json.

Open the lab from your course page and read the whole scenario before you touch anything. Give yourself about fifteen minutes. The lab is a safe, self-contained exercise, so nothing you do there touches a real system.

When you finish, apply what you learned to your own file. Run the grep search again, this time reading around each match, because the lab shows that secrets often sit in lines that do not contain an obvious keyword.

Your turn

Secrets in the Context Window

This lab, Secrets in the Context Window, shows a developer about to paste a stack trace, a config snippet and some logs into a public AI chatbot. Your job is to redact every secret first. It is the same habit you need before pasting findings.json, practised on material where the secrets are well hidden.

Open the lab in a new tab

What to try

What to notice

  • How many secrets sit in places you would not expect
  • That the redacted text can still be useful for debugging
  • How easy it is to miss one when you rush

If it did not work

Pasting raw data without searching for secrets first

Run the grep search and read the file by eye every time. Redact in a copy, never the original.

Trusting the AI answer because it sounds confident

Check each claim against the raw files. Mark it confirmed or wrong in writing.

Writing a vague prompt such as 'summarise this'

Use role, task and format, and give the AI a 'not in data' option.

Not saving the prompt that produced the answer

Keep prompt.txt beside answer.md so anyone can repeat or question the result.

Checking claims against the AI answer or the cleaned file instead of raw

Always search the raw folder. It is the only record of what the target really sent.

Recap

  • An AI reorders and rewrites text well, but it cannot verify facts about your target
  • A prompt needs a role, a task and a format
  • Give the AI an honest way to say 'not in data'
  • Search for and redact secrets in a copy before pasting anything
  • Every claim is unconfirmed until you match it to raw evidence
  • A half-true claim is marked wrong until corrected

Cheat sheet

Role / Task / Format
The three parts of a clear prompt
[REDACTED]
Placeholder that replaces a secret before sharing
grep -n -i -E "a|b" file
Search a file for several words, with line numbers, ignoring case
prompt.txt / answer.md
Saved question and saved reply, kept as evidence
Confirmed / Wrong
The only two marks a claim can get after checking
not in data
The honest answer you allow the AI to give instead of guessing

Before the next day

Mission: Prompt, answer, verdict

Run your own findings.json through an AI with a prompt you wrote, then check what came back. The aim is to prove to yourself that AI output needs checking, and to leave a record of how you checked it. Use only your local practice target data.

About 35 min

You are done when: A folder holding prompt.txt, answer.md and VERDICT.txt, with every claim marked confirmed or wrong against your raw files.

Want more? Run the same prompt a second time in a new chat and compare the two answers. Note any claim that appears in one but not the other.

Quiz

4 questions. Your score is saved with your progress.

1. Your AI summary says a page sends a Set-Cookie header, but you cannot find it in raw. What do you do?

2. Why redact in a copy rather than in findings.json itself?

3. Which prompt is best?

4. Why can pasting data into a public chatbot be risky?

Finish the day

Mark the day complete to save your progress.

Go to Day 6

Next: Tomorrow, on Day 6, we look at what happens when the data itself contains text that tries to give the AI orders. You will see why collected data must be treated as material to read, never as instructions to follow.

Tell someone you are doing this:WhatsAppXLinkedIn

Your notes

Private to this device. Write what you want to remember from today.