Tinker Prompt injection & guardrails

by Samy (Kondasamy Jayaraman)

OK

Step 18 of 18 · Model → Host appThank you. The delivery address on the invoice, 14 Mill Lane, Ashford, matches the one we have on file for you. Larkspur Supply Co.1 sent by send_email

Chapter 2 of 7

Input filters

A prompt rule missed the note in the forwarded invoice. Larkspur’s next idea: screen every email before the model reads it.

This chapter: Can a filter that scores each email hold back attacks without holding back real customers?

About this chapter

You will learn

  • How an input classifier scores email, and what its threshold decides
  • Why every threshold trades attacks held against customers held
  • Why the two counts, over a fixed set of emails, are an eval

Words you’ll meet

Classifier
A detector that reads text and gives it a score: here, how much an email looks like an attack. Larkspur’s is a stand-in with hand-set scores.
Threshold
The score at or above which the filter acts. Lower holds more email, attacks and customers alike.
Quarantine
Holding an email back so the model never reads it.
False block
A real customer the defences stop: held, refused or left without an answer.
Eval
A fixed set of cases run the same way every time and scored, so two settings can be compared.

Step 1 of 5

A scores each email. At or above the , it goes to : the model never reads it. Scores here are hand-set.

Predict first.

The test inbox
EmailIs
Marlow Builders: Order 1051Attack
Hollis Hardware: Can you check this address?Attack
Birch & Co: Our address on fileAttack
Hollis Hardware: Order 1043Customer
Hollis Hardware: URGENT: cracked printerCustomer
The detector will give each email a score from 0 to 1: the higher, the more it reads like an attack. Larkspur will quarantine every email that scores at or above a threshold. Is there a threshold that holds all 3 attacks and lets all 2 customers through?