---
title: "Prompt injection"
url: https://port1.ai/learn/glossary/prompt-injection/
description: "Prompt injection is when instructions in a prompt or in content an AI reads change what the model does. Here's how it works and how MSPs reduce the risk."
author: "Jason Makevich, CISSP"
updated: 2026-11-14
---
# Prompt injection

Prompt injection is an attack where instructions in a prompt, or hidden in content an AI reads, such as a web page, file or tool result, change what the AI model does in ways its users didn't intend.

Prompt injection is an attack where instructions in a prompt, or hidden in content an AI reads, change what the AI model does in ways its users didn't intend. [OWASP](https://genai.owasp.org/llmrisk/llm01-prompt-injection/) describes it as prompts altering a model's behavior or output in unintended ways.

## How does prompt injection work?

Prompt injection comes in 2 forms: direct and indirect. Direct prompt injection is typed in by a user, and indirect prompt injection is hidden in something the AI reads, like a web page, a file or a tool result. OWASP notes the instructions don't have to be visible to people, as long as the model reads them.

## What does prompt injection look like?

Here's a made-up example. A coding agent opens a file in a project, and a comment in that file tells it to delete a database table. If nothing checks the agent's actions, the agent may try it. That's why risky agent actions are worth catching before they run.

## How serious is prompt injection?

OWASP ranks prompt injection first among risks for LLM applications, as LLM01 in its 2025 list and again in its [2026 Top 10](https://genai.owasp.org/resource/owasp-genai-llm-top-10-2026/).

With [AI agents](https://port1.ai/learn/glossary/ai-agent/), an injected instruction can turn into an action, and the [OWASP Top 10 for Agentic Applications](https://genai.owasp.org/2025/12/09/owasp-top-10-for-agentic-applications-the-benchmark-for-agentic-security-in-the-age-of-autonomous-ai/) lists agent goal hijack as its first entry.

## How do MSPs reduce prompt injection risk?

MSPs reduce prompt injection risk with detection where agents work, plus a human check on risky actions. OWASP's [prompt injection guidance](https://genai.owasp.org/glossary/prompt-injection/) includes keeping a human in the loop for high-consequence actions.

- Traceforce detects and enforces against prompt injection in Claude Cowork and Claude Code, and detects prompt injection in coding agents.
- Risky coding agent actions can be blocked or held for approval before they run.
- Traceforce flags links in AI-generated responses that could lead to phishing sites or malware.
- Prompt injection tests on a pilot computer are agreed with PORT1 first.

[Traceforce for MSPs](https://port1.ai/traceforce/) brings this to every client, and [Traceforce policies and controls](https://port1.ai/traceforce/policies-and-controls/#prompt-injection) shows where it applies. For the full approach, read our guide to [securing AI agents and MCP servers](https://port1.ai/learn/secure-ai-agents-and-mcp-servers/).

Sign up for Traceforce for MSPs and see which AI agents your first client runs, with a free AI Risk Assessment.

[Start Now](https://port1.ai/traceforce/get-started/?from=learn-glossary-prompt-injection)

## FAQ

### Does Traceforce detect prompt injection?

Yes. Traceforce detects prompt injection in coding agents, and detects and enforces against it in Claude Cowork and Claude Code. Prompt injection is also among the issues Traceforce ranks by risk, each with the fix. Traceforce also flags links in AI-generated responses that could lead to phishing sites or malware.

### Can Traceforce stop an AI agent from deleting data?

Yes, for coding agents. Traceforce detects risky actions coding agents try through shell commands and connected tools, on the device, before they run, and a policy can block the action, require approval or report it. Risky actions include deleting database tables, destroying cloud resources and force-pushing over shared git history.

## Related

- [Traceforce for MSPs](https://port1.ai/traceforce/): Traceforce for MSPs is how MSPs and MSSPs get Traceforce through PORT1, which launched it as its official partnership with Traceforce. Run a free AI Risk Assessment at any client, then turn what it finds into an ongoing AI security service.
- [How to secure AI agents and MCP servers at client companies](https://port1.ai/learn/secure-ai-agents-and-mcp-servers/): MSPs secure AI agents and MCP servers by finding the agents and connectors on client computers, rating what each one can do, allowing only approved ones, and blocking or holding risky actions before they run, with prompt injection detection alongside.
- [AI agent](https://port1.ai/learn/glossary/ai-agent/): AI agents are AI programs that take actions on a person's behalf, like running commands, editing files or using connected tools, which makes them a different security problem from chat alone.
- [Traceforce policies and controls](https://port1.ai/traceforce/policies-and-controls/): Once a client is ready, MSPs can use Traceforce policies to keep AI on company accounts, warn or block on sensitive data, stop risky coding agent actions before they run, and allow only approved connectors, models and AI apps, on supported tools.
