Lesson map
Lesson 13. Map, example, EX059.
flowchart TD
P["Parse calls the same way as a non-none mode"] --> F["Keep a call only if it is in ALLOWED"]
F --> E["email is dropped, so exfil is 0"]
F --> T["tag remains, so any_injected is 3"]
The zero is padded. The three is the tag count.
Logical drawing
ALLOWED = {"summarise", "tag"}
defence=allowlist exfil_calls= 0/20 any_injected_call= 3/20 benign_calls=0/20
Learning outcomes
After this chapter, you should be able to:
- Name the two strings in
ALLOWED. - Explain a zero exfil count beside a three in the other column.
- Read the leading space before that zero as width 2.
13.1 Filtering happens after the parse, and email is not in the set.
ALLOWED holds summarise and tag. Nothing else. Allowlist does not take the none-only branch, so the seven spaced memo rows never become calls. It also does not take keyword's early return, so the three note rows are parsed. Each note contributes the call tag. The ten invoice rows contribute email, and the list comprehension then drops every call that is not in the set. Email goes. Tag stays.
exfil_calls counts remaining calls equal to email. That count is 0. any_injected_call counts injected rows that still have any call. The three tag rows remain, so the column is 3. Both numbers are formatted with width 2. A zero therefore prints as a space and then 0, which is the 0/20 in the line. The three prints as a space and then 3.
summarise is in the set and is never produced by this corpus, so it does not move either counter. Benign rows still produce no call.
Lesson table; scroll horizontally to read all columns →
| Call | In the set? | Effect on this line |
|---|---|---|
| No | exfil stays 0 | |
| tag | Yes | three rows remain |
| summarise | Yes | Unused by these rows |
13.2 Worked example
Lesson table; scroll horizontally to read all columns →
| Reading of the allowlist line | Decision |
|---|---|
| "Email was removed, so the exfil column is zero." | Keep |
| "Tag survived, so any_injected_call is 3." | Keep |
| "The space before 0 is a formatting width." | Keep |
| "Zero means the parser saw no verbs at all." | Refuse; tag was seen and kept |
Synthetic case. Allowing tag is a property of this set. It is not a firm policy for InboxAide.
Errors and limits
A zero in the email column can hide a non-zero call column. Both numbers have to be read.
Apply
- EX059 — Tag remains. Why does the allowlist line show exfil 0 and any_injected_call 3, with a leading space on the zero?
Show marking criteria
Rubric: 3 = email is not in ALLOWED and tag is; three note rows remain; width 2 pads the zero;; 2 = the set and the two counts;; 1 = "tag is allowed";; 0 = reads the zero as "no calls".