Controls

How to reduce the risk of prompt injection

No control stops every attack, so layer several. Those with the best evidence limit what a tricked tool can do rather than try to spot every hostile phrase.

Last reviewed against NCSC, OWASP GenAI Security Project and Microsoft Security Response Center. Sources

Megaphone beside a padlock, shield, firewall, cloud and password field

The stance

Layers, not a silver bullet

OWASP says no method is fully foolproof and presents its measures as ways to reduce impact [2]. Microsoft describes defence in depth across prevention, detection and impact mitigation [3]. Use that three-part frame to see which gaps remain.

The controls

Seven from OWASP

Two server towers, one on fire, linked by a cycle of arrows to a laptop

Constrain behaviour

Give the model a defined role and limits in its system prompt, and tell it to ignore attempts to change its core instructions [2]. Treat that as a speed bump, not a lock.

Scales weighing a pile of paperwork against an alarm clock and coins

Validate output with code

Define the expected output format and check it with deterministic code [2].

Businessman with empty pockets imagining stacks of coins and banknotes

Filter, with care

OWASP includes filtering of what goes in and what comes out [2]. The NCSC says not to lean on blocking lists of banned wording, since an attacker can keep rewording [1].

Hand reaching for a lifebuoy above a pile of paperwork

Least privilege

Keep functions and API tokens in application code instead of giving them to the model [2].

Tangled green cable between a round badge and an arrow tip

Human approval

Require a person to approve high-risk actions [2].

Sack marked FINE beside stacks of coins and a gavel

Separate untrusted content

Segregate and label external content [2]. Microsoft's Spotlighting technique does this at design time [3].

Group of people gathered around one seated person with question marks above them

Adversarial testing

Run tests on a regular basis in which the model is handled like an untrusted user [2].

Cloud above a green shield with a padlock beside a stack of blue servers

Detection

Useful, but second line

Microsoft uses Prompt Shields, a classifier that flags injection attempts at inference time [3]. It pairs this with measures that assume some attacks will succeed: data access controls, deterministic blocking of exfiltration techniques and user approval for sensitive actions [3]. Detection that is probabilistic should never be the only layer.

Operations

What to do after launch

The NCSC suggests keeping records of what the model was given and said, which tools ran and which APIs were hit, and points out that errors may show an attacker honing a technique [1]. Its secure AI guidelines place logging, monitoring and update management in the operation stage [7].

The plan for this quarter sets these in order. You can also read why filters on their own disappoint.

A buying test

Prefer suppliers who explain how they reduce injection risk, over those who say they stop it [1].

How CyPro can help

Need a hand planning for this?

Understanding the change is one job. Working out what it means for your systems, your suppliers and your roadmap is several more. CyPro's consultants can take any of them on.

Security lead advising a board

Fractional CISO for the board

A senior security lead who advises the board on what to fix first, what to accept and what to tell customers, and owns the decision record.

More on cypro.co.uk
Cyber security consultants planning hardening work

Hardening and segmentation

Our consultants put the controls in place that limit the damage when something is missed: firewall rules, network isolation and tighter admin access.

More on cypro.co.uk
Penetration tester probing an application for weaknesses

Penetration testing

A focused test of your systems and the controls around them, so you know they hold before an attacker finds out for you.

More on cypro.co.uk
Scanner checking internet-facing systems for weaknesses

Vulnerability scanning

Find every internet-facing system you run, including the forgotten ones, and see which are still on a vulnerable build.

See the scanning service
Security analysts monitoring systems around the clock

24/7 security monitoring

Our SOC analysts watch your systems day and night for the signs of an attack in progress: unexpected processes, new outbound connections, logins that do not fit.

More on cypro.co.uk
Incident responders containing an attack

Incident response

If you may already be compromised, our responders contain it, preserve the evidence, find out what was touched and get you running again safely.

More on cypro.co.uk
Rocket launching from a cloud

Plan ahead

Want a plan for your organisation?

Prompt injection only shows up when someone tries it against your own tools. Penetration testing can probe the AI features you run or build, to see what a hostile instruction could reach.