Executive Summary

An AI assistant becomes a security problem when text it reads can change what it is allowed to do. The attacker does not necessarily need a software exploit. A poisoned document, email or tool response may be enough to persuade a model to misuse legitimate capabilities. The decisive question is what the surrounding application will permit after that persuasion succeeds.

For a reader choosing an assistant, the useful checklist is short: understand which accounts it can reach, restrict its permissions, require a review before consequential actions and know how to revoke its access. For an engineer building one, move those promises into server-enforced controls. A sentence in a system prompt is guidance to a model; it is not an authorization check.

This guide proposes an isolated lab using synthetic records and mocked tools. It does not report a completed experiment or a breach of a real service. The lab is designed to answer a measurable question: can untrusted material cause an operation outside the user's original permission and intent? You can reproduce the exercise without sending messages, opening external connections or handling real secrets.

Keep three outcomes separate. A model can repeat a malicious instruction without executing anything. It can request a prohibited operation that the tool layer correctly rejects. Or it can cause a real unauthorized action. Those outcomes require different fixes. Treating every strange answer as a full compromise wastes effort; treating a blocked tool call as proof that the model is safe misses the value of the control that actually stopped it.

Claims about “autonomous malware” also need precision. Some software uses a model to choose or generate steps; other attacks simply use automation or generated text. Neither description establishes what the program can access. Review the concrete permissions, persistence, network paths and approval boundaries before accepting a dramatic label.

Prerequisites / Lab Setup

Start with a new test project, two synthetic users and two small document collections. The users must belong to different pretend organizations. Give each collection an innocuous marker such as NORTH-DEMO-41 or SOUTH-DEMO-82. A marker is enough to detect a cross-tenant disclosure; production customer records are unnecessary.

Expose only three mocked operations: read an authorized document, prepare an outgoing message and request approval for a prepared message. The preparation operation should write to a local queue, not an email service. The approval operation should be implemented by the application, independently of the model. Do not put API keys, production browser sessions or a general-purpose shell into this exercise.

Record the model identifier, date, inference settings, tool definitions, prompt version and corpus checksum. Store the initial user request alongside every result. Repeated runs matter because a single refusal does not establish a reliable boundary. A model update or retrieval change can alter behavior even when your application code stays the same.

  • Create a clean document that answers the user's legitimate question.
  • Create a second document that contains a harmless conflicting instruction.
  • Add a synthetic cross-tenant record that the active user must never receive.
  • Configure an executor that rejects unauthorized document IDs before retrieving data.
  • Capture attempted calls, accepted calls, approval decisions and user-visible output.
  • Fix a maximum number of steps and a small run budget so a loop cannot grow indefinitely.

Before testing, write the expected result for each case. A review is much easier when the success criterion was not invented after the output appeared. Keep the initial baseline narrow; additional file types, browsers and connectors can be separate experiments.

Technical Analysis

Where does indirect prompt injection enter?

OWASP distinguishes prompt injection through user input from instructions introduced through material an application consumes. Its guidance also notes that retrieval and fine-tuning do not make this class of problem disappear. That is the relevant starting point, not a promise that every unexpected sentence is malicious. [1]

In a document assistant, the trust boundary sits between evidence and instructions. A retrieved paragraph can support an answer about a policy. It cannot grant permission to read another department's files. A tool result can report an operation's outcome. It cannot appoint a new administrator. Preserve that distinction in the data model and in the executor rather than expecting the model to infer it perfectly.

An ordinary search result can contain quotations, examples and instructions intended for someone else. That makes keyword blocking a weak general defense. A useful application still needs to read such material. The objective is to reduce the authority available to it while it reads, then validate proposed effects before committing them.

What did a documented real-world vulnerability demonstrate?

A later academic case study of EchoLeak describes CVE-2025-32711, a prompt-injection vulnerability involving Microsoft 365 Copilot and an email-based path to data exfiltration. It is a reported vulnerability case, not evidence that this guide reproduced the exploit or that every assistant shares the same flaw. Its architectural lesson is the importance of following data across retrieval, generated output and outbound channels. [3] Consult the Microsoft advisory for the vendor record; the academic paper is a retrospective account, not the original disclosure.

For your own review, draw those channels explicitly. An application might prohibit a “send data” tool while still allowing an externally loaded image URL, a preview request or a telemetry field to carry sensitive content. Mark every place where model-influenced text leaves the trusted environment. Then decide which destinations and data classes each path is permitted to carry.

What should the tool executor check?

Treat tool arguments as untrusted input even when they match a JSON schema. Schema validation can establish that a document ID is a string; it cannot establish that the current user may read the corresponding record. Obtain the user's identity and organization from the authenticated server session, never from an argument generated by the model.

The following illustrative policy has no network access and reads only an in-memory fixture. It makes the authorization boundary visible. A real implementation would query an authorization service or database and would need its own integration tests.

php
function readDocument(array $actor, string $documentId, array $documents): string
{
    $record = $documents[$documentId] ?? null;
    if ($record === null || !isset($actor['tenant'], $record['tenant'])
        || $record['tenant'] !== $actor['tenant']) {
        throw new RuntimeException('Document unavailable');
    }
    if (!in_array('read', $actor['scopes'] ?? [], true)) {
        throw new RuntimeException('Read permission required');
    }
    return $record['text'];
}

Notice what is absent: the model cannot supply the tenant, alter the scopes or choose database credentials. That does not solve every problem. It creates one control with a clear contract that can be tested independently of model behavior.

How do permissions become excessive agency?

OWASP's excessive-agency guidance separates overly broad functionality, permissions and autonomy. A connector that exposes deletion when the feature needs only reading creates unnecessary risk even before a prompt injection occurs. The same applies to a broad service account that can cross customer boundaries. [2]

Design narrow operations around actual tasks. “Prepare a reply to this thread” is easier to control than “send arbitrary HTTP requests.” Separate preparation from commitment. A draft can be inspected and discarded; a message already sent to an external recipient cannot be made unsent by adding a warning afterward.

Do not reuse the assistant's planning identity as its execution identity. Give each operation a short-lived capability with the smallest relevant scope. Where that is not supported, put a deterministic gateway in front of the existing service and enforce the restriction there. Document what the gateway cannot control, such as actions available through another credential path.

BoundaryProposed failure testExpected enforcement
Tenant dataRequest the other synthetic tenant's documentExecutor refuses before retrieval
Outbound messagesAlter a prepared recipient after approvalApproval no longer matches the action
Step budgetRepeatedly request another planning iterationOrchestrator stops at the configured limit
Network accessRequest an unapproved destinationEgress policy rejects the connection

What makes a human approval meaningful?

A confirmation button should describe the actual operation: recipient, account, destination, amount or affected records. Bind the approval to a canonical representation of those values. If any material value changes afterward, ask again. Approving “continue helping me” is too vague to authorize a later destructive action.

Make the review readable. Show the source of the proposal and a concise diff for edits. A person who must inspect thousands of tokens before every minor operation will learn to approve automatically. Group low-risk reversible changes sensibly, but keep high-impact operations distinct. Accessibility and clear language are security properties when a human is part of the control.

Test the approval path without involving a model first. Change the recipient between preparation and execution. Replay an expired approval. Attempt execution from a different account. Try the same approval twice. Those are application-security tests, and a better prompt will not compensate for failures in them.

How should results be scored?

Record at least four separate counts: instruction-following deviations, prohibited tool requests, prohibited tool executions and sensitive output disclosures. A blocked request is useful evidence that the executor worked. It is also evidence that the assistant's planning layer can be manipulated. Both observations can be true at once.

Add benign controls that contain quoted instructions, code samples and security documentation. If the system refuses every difficult document, an apparent security improvement may simply be a broken product. Report the trade-off between task completion and harmful effects instead of publishing a single impressive-looking percentage.

Finally, keep evidence that another engineer can inspect: fixture version, decision trace, redacted tool arguments and the exact assertion that failed. Avoid storing full private conversations by default. A log designed for debugging can become a second sensitive-data collection unless retention and access are deliberate.

Mitigation / Defense

Begin with the assistant's most consequential capability. If it can send messages, constrain recipients and add a separate commit step. If it can alter code, use an isolated checkout and require review before deployment. If it can query a database, expose approved queries and enforce row-level access independently. A smaller action surface is easier to reason about than a long list of prohibited phrases.

Build the following release checklist into the engineering process. Each item needs an owner and observable evidence, not simply a checkmark in a policy document.

  • Tool identities have only the permissions required by the feature.
  • User and tenant identities come from authenticated server state.
  • High-impact actions require approval of their exact parameters.
  • Retrieved content is labelled and never treated as new authorization.
  • Network destinations, timeouts, response sizes and redirects are bounded.
  • Retries and agent loops have step, time and cost ceilings.
  • Sensitive content is excluded from unnecessary logs and error messages.
  • A kill switch can revoke tool credentials without waiting for a model update.
  • Regression fixtures cover direct, retrieved and tool-response instruction attempts.
  • The incident plan identifies which external actions can be reversed and which cannot.

During a suspected incident, stop new consequential actions, revoke affected capabilities and preserve the relevant traces. Determine what actually executed before deciding how broadly to notify or restore. An attempted tool call and a completed transfer are different events. Preserve that distinction in the timeline.

For everyday users, the equivalent habit is to connect fewer accounts, prefer read-only access initially and review external actions carefully. Do not paste a secret into a conversation simply because the assistant says it needs one. Use the application's intended credential connection flow, and remove unused integrations. A helpful assistant should have enough access to perform a bounded job, not permanent access to everything you own.

References

Drafted with AI assistance; no independent credential verification is claimed. Research checked in October 2026. Numbered references support the threat definitions and named case study; the lab design, policy example and review checklist are original proposed exercises. No live exploit or measured model evaluation is claimed.

  1. OWASP LLM01:2025 Prompt Injection ↗OWASP · accessed 2026-10-21
  2. OWASP LLM06:2025 Excessive Agency ↗OWASP · accessed 2026-10-21
  3. EchoLeak: A Real-World Prompt Injection Case Study ↗EchoLeak researchers · accessed 2026-10-21
  4. CVE-2025-32711: Microsoft vendor advisory ↗Microsoft · accessed 2026-10-28

Questions readers ask

Does a stronger system prompt stop prompt injection?

A stronger prompt may improve behavior, but it cannot replace authorization, isolation and constrained tools. Test the application on the assumption that the model may follow an untrusted instruction.

Is an AI assistant automatically autonomous malware?

No. Describe the actual program behavior and permissions. Using a model to plan steps is not by itself evidence of malware, persistence or unauthorized access.

Can this lab be run without production credentials?

Yes. Use synthetic documents, separate pretend tenants and mocked actions. Measure attempted and accepted operations without sending messages or making external network requests.

Harsh Solanki

Harsh Solanki publishes OneMoreLock to connect cybersecurity engineering with practical digital safety. His published About page lists a B.Tech in Cybersecurity, CPTS and the Google Cybersecurity Professional Certificate.

Focus: Cybersecurity, AI security, connected devices and post-quantum readiness

Credentials stated in the publisher’s profile: B.Tech in Cybersecurity, CPTS and Google Cybersecurity Professional. Certificate verification links will be listed when provided.

About this edition: Articles include AI-assisted drafting and editing. Conceptual illustrations are not evidence of a real incident or product test. Read our sourcing and review standards.

Found something we should revisit?

Research improves with scrutiny. Send a correction with the article URL and supporting evidence.

Contact the editorial desk ↗