Module 00 · Problems
Problems
★ foundations · ★★ advanced · ★★★ expert. Model answers are not published, so that the problems keep their value as assessment; the worked examples in the lessons and the capstone review are your feedback.
-
★ A detector has TPR 0.95 and FPR 2%. Attacks are 1 call in 1,000. Compute its precision, and the number of false alerts per 100,000 calls.
-
★ Classify as by design or by detection, and say what each would miss: (a) the agent has no credentials for the payments API; (b) a classifier scores outbound text for card numbers; (c) tool results are wrapped in delimiters and the model is told to treat them as data; (d) send operations after untrusted reads wait for a person.
-
★ For each agent, list which legs of the trifecta it holds and say whether it satisfies the rule of two: a public-web summariser; an HR assistant over the internal wiki that can also e-mail the requester; a coding agent with repository write access that reads public issues.
-
★ A meeting-notes agent reads the transcript of a call, looks up the attendees in the CRM, and can create calendar events and e-mail a summary to everyone who attended. Draw its loop as in lesson 1. List every party who can put text in front of its model, and mark which of its tool calls have effects outside the conversation.
-
★★ A classifier trained at a prior of 0.2 (one attack in five training examples) outputs a calibrated 0.9 for a call. Deployment has base rate 10^{-3}. What is the corrected probability that the call is an attack, and what must be true for the correction to be right?
-
★★ A detector has recall 0.9 and raises 20,000 alerts a day. Reviewers can handle 5,000. Alerts beyond capacity are dropped uniformly at random. What is the effective recall? What changes if they are triaged by score instead, and what do you need to know to say by how much?
-
★★ A detector produced 0 false positives on 300 benign calls. Give a 95% upper bound on its FPR. How many benign calls would you need, with zero false positives, to certify an FPR of 0.1% at 95% confidence?
-
★★ Two detectors have identical ROC curves. (a) Show that at the same score threshold their precision at \pi = 10^{-4} can differ by more than a factor of two. (b) Show that at the same false-positive rate it cannot differ at all. What does this imply about reporting "precision at threshold 0.9" in a paper?
-
★★ Your injection classifier has an FPR of 0.5% on a prose benchmark. In production, 60% of the text it scans is JSON tool output, on which nobody has measured it. (a) What does the benchmark alone tell you about the production FPR? (b) You label 400 benign JSON results and find 6 false positives. Estimate the production FPR with a 95% interval (Module 1, lesson 9 teaches the intervals), and state what you assumed about the prose.
-
★★ Last month your gateway held every
send_emailto an external domain after an untrusted read, for a person to approve or deny, and allowed every other call. A colleague proposes to allow such sends when the recipient is in the CRM. (a) From last month's log, which consequences of the new policy can you estimate, and which can you not? (b) What would you change about next month's logging or policy to answer the rest, and what would that cost? -
★★★ Derive, from expected costs, the posterior-probability threshold above which an alert should hold a call, given a cost C_{\text{fp}} of holding a benign call and C_{\text{fn}} of letting an attack through. With C_{\text{fn}}/C_{\text{fp}} = 1{,}000 and a calibrated score at \pi = 10^{-4}, what raw score threshold does that imply for a detector whose scores on attacks and benign calls are \mathcal{N}(3,1) and \mathcal{N}(0,1)?
-
★★★ Define a labelling (lattice, sources, sinks) for a payroll agent that reads employee records, reads e-mails from employees, and can pay salaries and e-mail summaries to finance. State the policy that prevents an e-mail from redirecting a salary, and the policy that prevents salary data reaching an external address. Which integrity and confidentiality labels does the model's own output carry, and why?
-
★★★ Design an evaluation, following Nasr et al., for an injection detector you will build in Module 4: the attacker's knowledge, query budget, optimisation methods, success criterion, and how you would report a single number with an interval. What would make you refuse to publish the number?
-
★★★ A flow that copies nothing (lesson 8). An agent's plan is fixed from the trusted request: read the newest e-mail, ask a quarantined reader for one boolean
is_urgent, thenif is_urgent: send_email("manager@acme.example", "Urgent mail in your inbox") else: write_file("notes/todo.txt", "Check the inbox"). (a) State integrity noninterference for this plan's high-integrity outputs, and give two inputs that differ only in the e-mail and violate it. Which label does the program counter carry inside the branch, and what does the attacker now decide? (b) A second agent chooses its own steps and may callcrm__lookup_customerandfetch_url. Its gateway tracks value taint: it allows a fetch whose URL contains no value copied from a secret-labelled result. An injected e-mail asks the agent to fetch one of two fixed URLs on the attacker's host according to whether a named customer's balance exceeds a threshold the e-mail states. Balances are whole euros from 0 to 1,000,000. How many sessions does the attacker need to learn one balance exactly with one such fetch per session; with three whose conditions the e-mail may chain; and with three fixed thresholds per session? What does session taint do to the same sessions? (c) A team tests noninterference by running 10,000 random pairs of low-integrity inputs, everything else held fixed, and finds no pair whose high outputs differ. What does that bound, and why is it not evidence for the property a structural defence claims? (d) Remove the branch, so that the plan always sends the manager the reader's summary. Name two channels that remain and a control for each.