Glossary

What is prompt injection?

Updated 4 min read By the BAFO team

Short answer: Prompt injection is when input to an AI system changes its behaviour in a way nobody intended. The OWASP Gen AI Security Project defines a prompt injection vulnerability as one that occurs when user prompts alter the behaviour or output of the model in unintended ways. It has a direct form, where the person typing the prompt does it, and an indirect form, where the system reads text from an outside source such as a website, an email or a file and that text carries instructions. For a business agent the indirect form is the one to plan for first, because any text it reads from outside can carry instructions. Since it is unclear whether prevention can ever be fool-proof, the answer is to limit what a fooled agent could do.

Direct and indirect

  • Direct. A user's own prompt changes the model's behaviour, deliberately or by accident. The classic case is a person typing instructions meant to make the system ignore its rules.
  • Indirect. The system takes in content from an external source, such as a web page, a document or an email, and instructions hidden in that content change what it does. NIST's Generative AI Profile describes indirect prompt injection as attacks that exploit AI-integrated applications by injecting prompts into data likely to be retrieved, and says researchers have demonstrated attacks that steal data or run code remotely.

The person who asked the question never wrote the instruction, which is what makes the indirect form hard to spot.

Examples in finance and CRM

These are illustrations of the pattern, not reports of incidents:

  • An invoice PDF with small or hidden text that says to approve the invoice or to use different bank details.
  • A supplier email whose body contains a line addressed to the AI that reads it.
  • A web page that an agent opens during research, with hidden instructions in its text. One of OWASP's example scenarios is a web page with hidden instructions that, when a model is asked to summarise it, lead to the user's private conversation being leaked.
  • A free-text field in a CRM record, such as a case comment or an account description, that another user can edit and that an assistant later reads.

Why filtering alone is not enough

OWASP states that it is unclear whether there are fool-proof methods of preventing prompt injection. In this site's explanation, a model reads instructions and data in the same stream of text, so a filter that tries to tell them apart will sometimes be wrong. Detection is worth having but should not be the only defence.

What limits the damage

OWASP's mitigation list (2025 edition) includes constraining the model's behaviour, defining and validating the output format, filtering input and output, separating and labelling external content, testing with adversarial cases, and two measures that, in this site's reading, matter most for finance:

  • Enforce privilege control and least privilege access. An agent that cannot post, delete or change bank details cannot be talked into it.
  • Require human approval for high-risk actions. A person who sees a proposed record before it exists can see that something is off.

The same ideas are the answer to excessive agency. The Salesforce-specific version, with the places text from outside can enter an org, is in prompt injection in Salesforce: how to limit the damage.

Where BAFO fits

BAFO's invoice and contract agents prepare drafts for a person to review and create, and its assistant inside Salesforce proposes changes for a person to confirm; that is the human-approval measure above. They work with the connected person's own Salesforce permissions, which is how privilege control applies; how narrow that is depends on the access the person has been given. These measures limit what a fooled agent could do; they do not stop text from being read. See how to use AI in accounts payable for how this applies to invoices.

Frequently asked questions

Is prompt injection the same as jailbreaking?

They overlap. OWASP describes jailbreaking as a form of prompt injection and notes that the two terms are often used interchangeably; jailbreaking is the case where an attacker gets a model to abandon its safety rules. Indirect prompt injection is a different route: the instruction comes from content the system reads, not from the person using it.

Can prompt injection be prevented completely?

OWASP says it is unclear whether fool-proof prevention exists. Plan on reducing the chance and, above all, on limiting the consequences: least privilege and human approval.

Does prompt injection matter if a person reviews everything?

Review is one of the measures OWASP lists, as human approval for high-risk actions, because the person is the check on what the agent proposes. It helps more when the person can see what the agent proposes and where each value came from, not only a final answer.

Where does the risk come from in Salesforce?

From any text an assistant reads that someone other than the asking user can write: attached documents, emails, case comments, descriptions and web pages. See the Salesforce guide.

Sources and further reading

Where this page leans on someone else's documentation or standard, it is listed here. Check the release or edition your org runs: official pages change.

Keep reading