Google analytics are off.

Promptective journal / Guide

Protecting LLM applications

A practical defence-in-depth guide.

A compact LLM application core sits inside sandstone, oxide and smoked-amber protective layers with separate controlled inputs
An LLM application needs independent layers around the instructions, data and actions that reach its model.

LLM applications need controls for prompt injection, jailbreaks, data exfiltration, abusive resource use and harmful output.

The threat model

Map instructions, user input, retrieved content, output, tools and sensitive data. Assess what an attacker could read, change or trigger.

Model the whole application

Instruction attacks

Prompt injection and jailbreaks try to redirect model behaviour.

Data exposure

Secrets, personal information and private context can cross the wrong boundary.

Resource abuse

Large or repeated requests consume capacity and increase cost.

Unsafe action

Outputs can drive tools, APIs and user-visible decisions.

Threats can target the model, the sensitive context around it, the availability of the service, or the actions connected to its output.


Defence-in-depth architecture

No single defence is sufficient. Use independent layers:

1. Validate input

Enforce size and schema limits, normalise text and inspect untrusted content. Filtering reduces common attacks but cannot prove safety.

2. Protect instruction boundaries

Separate trusted instructions from untrusted data and keep secrets out of prompts. Prompt wording alone is not a security boundary.

3. Validate output

Check formats and sensitive-data rules before displaying output or passing it to another system. Treat model output as untrusted.

4. Monitor and enforce

Use monitoring and enforcement controls to:

  • Record content-minimised policy and delivery facts
  • Detect unusual patterns and tool use
  • Alert security teams
  • Allow, audit, redact, require approval or block according to policy

Four controls around the model

1

Input validation

Bound, normalise and inspect content before inference.

2

Instruction hardening

Keep policy explicit and separate from user-controlled data.

3

Output filtering

Check generated content and transformations before delivery.

4

Monitoring and policy

Record the decision and apply the configured response.

Each layer owns a different decision, so one missed signal does not automatically become an unsafe response or action.


Secure tool use

If your LLM has access to tools (APIs, databases, etc.):

Grant necessary permissions, validate parameters, isolate execution and require exact human approval for sensitive actions. Apply rate, token, concurrency and cost limits.

Treat every tool call as a proposed action

1

Model proposal

A tool name and argument set are generated from the conversation.

2

Validate

Check schema, identity, resource scope, rate and action risk.

3

Approve or deny

Require exact human approval when policy classifies the action as sensitive.

4

Isolated execution

Run with narrow credentials, network access and filesystem scope.

The model can propose an action. Deterministic controls decide whether that exact tool, scope and argument set may execute.


Deployment checklist

Before deploying an LLM application:

  • Validate inputs and outputs
  • Separate instructions from untrusted content
  • Minimise tool and data permissions
  • Configure resource limits and monitoring
  • Test prompt injection and tool-abuse cases
  • Prepare incident response and review controls as attacks change

For the broader production program, including retrieval, data handling, agent authority, testing and incident response, use the LLM security best-practices guide.


Promptective monitors and enforces supported AI paths with content-minimised evidence. Explore the protection model for your organisation's AI workflows.

Security review

Map policy to the AI paths your team uses.

See where Promptective can apply organisation policy and record content-minimised evidence.

Map your AI workflows