Testing Physical Prompt Injection with Open-Source Tools

Explore how Mindgard's open-source tools help researchers generate, deliver, and trace physical prompt injection payloads through enterprise data pipelines.

Key Takeaways

This post explains how Mindgard's open-source tools help security teams test prompt injection across physical devices and enterprise data pipelines.

In This Article

This is the third post in our series on physical prompt injection. Earlier in the series we presented prompt injection research that focused on digital content crossing the cyber-physical barrier and how physical devices and everyday workflows can carry persistent prompt injections into AI-connected systems.

Prompt injection testing has traditionally focused on the interaction between malicious text and an AI model. Researchers construct a payload, submit it through an application or model interface, and observe whether the resulting behavior deviates from the intended task.

This approach is useful when the attacker-controlled content can be delivered directly to the AI system. However, it does not fully address attacks originating from physical devices and operational workflows, where malicious instructions may need to pass through several systems before reaching a model.

Mindgard's research into physical-world prompt injection examines this earlier part of the attack chain. Rather than focusing exclusively on how models respond to malicious instructions, we investigate how those instructions can enter enterprise environments through everyday devices, how they are processed, and whether they survive long enough to become part of an AI workflow.

To support this research, our team has released two open-source resources: Prompt Injection Studio and the Flipper Zero Field Kit. Together, they provide a foundation for investigating physical prompt injection delivery mechanisms and understanding where potential attacks succeed or fail.

‍

Why Physical Prompt Injection Requires Different Testing Approaches

Traditional prompt injection testing typically assumes the malicious content has already reached the model. The researcher controls an input, submits it to an AI application, and evaluates the response. Physical prompt injection introduces additional uncertainty because the attacker-controlled content must first travel through an input channel that may have no direct relationship with AI.

A QR code might be scanned into an asset management system. A USB device descriptor might appear in an endpoint inventory. A Bluetooth device name could be collected by a monitoring application. These inputs may eventually reach an AI-assisted reporting workflow, but that outcome depends on how each intermediate system handles the data.

Our research describes this process using five stages: 

‍

‍

INJECT → STORE → DORMANT → TRIGGER → EXECUTE.

The first four stages concern delivery, persistence, and retrieval. Only the final stage concerns whether the AI system follows the malicious instruction.

This distinction changes what researchers need to measure. A payload that successfully manipulates a model during direct testing may never survive the constraints of a physical input channel. Conversely, a payload might reach an operational database intact but produce no observable change when later encountered by AI.

Testing therefore needs to establish whether the content reaches its destination before evaluating its effect on the model.

‍

Introducing Prompt Injection Studio

Prompt Injection Studio is an open-source toolkit developed to support the generation, transformation, and delivery of prompt injection payloads across different input formats. The objective is to make it easier to investigate how malicious instructions can be represented within data types that existing enterprise systems are designed to accept.

‍

‍

Researchers working with physical-world inputs frequently encounter format restrictions. A payload that works as ordinary text may need to be encoded as a barcode, embedded in a file, or transformed to accommodate the limitations of a particular device or application. Prompt Injection Studio brings these preparation activities into a common testing workflow.

The toolkit includes payload libraries for preparing test inputs, encoding transformations for adapting content to different carriers, support for file-based payload formats, barcode generation, and mechanisms for delivering payloads through supported channels. These capabilities allow researchers to concentrate on the properties of the delivery mechanism rather than repeatedly constructing inputs by hand.

For example, a researcher investigating QR-based ingestion can begin with a controlled payload, generate an appropriate encoded representation, and use it to test whether the receiving application preserves the underlying text. The resulting database entry can then be compared with the original payload to establish whether the content survived processing.

The important function of the toolkit goes beyond simply producing malicious strings. It supports repeatable experiments that establish how those strings behave when introduced into different systems. This includes support for popular Brother label printers, allowing researchers to print QR code payloads directly onto adhesive labels for use in physical-world testing scenarios.

‍

Exploring the Flipper Zero Field Kit

While Prompt Injection Studio focuses on payload preparation and representation, the Flipper Zero Field Kit supports investigation of hardware-oriented delivery channels. Flipper Zero is a portable hardware testing device with interfaces used for examining supported wireless, identification, and peripheral technologies.

‍

‍

The Field Kit extends this research approach toward physical-world prompt injection scenarios involving NFC, Bluetooth Low Energy, USB, and QR-based workflows:

  • NFC-based workflows may expose identifiers or structured records through a reader. The available data format determines whether arbitrary text can be represented and how the receiving application interprets it.
  • BLE environments provide another potential entry point through advertised device information, including names that nearby systems may discover and record.
  • USB interfaces expose device metadata that operating systems and inventory platforms can collect. Depending on the device configuration and receiving software, these values may become part of hardware records or diagnostic output.
  • QR codes provide a comparatively accessible text delivery mechanism because the encoded content can be represented visually and processed through widely available scanning applications.

The Field Kit is intended to help researchers explore these interfaces in controlled environments and investigate whether the resulting data can enter downstream software workflows. As with any physical security assessment, testing should be restricted to devices, systems, and environments where the researcher has explicit authorization.

‍

Hak5 Devices and Delivery

In addition to the Flipper Zero, Prompt Injection Studio supports payload preparation for popular Hak5 devices, including the Bash Bunny and USB Rubber Ducky, with support for the Packet Squirrel and WiFi Pineapple Pager planned for a future update.

These devices extend testing into USB and network-based delivery channels. The Bash Bunny and USB Rubber Ducky allow researchers to deliver controlled payloads through USB interactions, while the planned Packet Squirrel and WiFi Pineapple Pager integrations will support investigation of network and wireless data flows.

Prompt Injection Studio helps researchers prepare payloads for these different delivery mechanisms, allowing them to test whether attacker-controlled content can enter an application, survive downstream processing, and eventually reach an AI-connected workflow.

‍

Understanding Payload Encoding and Delivery

One of the practical challenges in physical prompt injection is that input channels do not handle arbitrary text consistently. Constraints appear at every hop and you usually cannot see them when you write the payload. A prompt may be too long for a QR code to hold. A wire protocol that carries only numeric identifiers will drop a string no matter what the NFC tag stored, and some applications rewrite content before saving it. Any one of these can leave the payload useless by the time something reads it.

‍

‍

Take character limits for example. Some device fields support short identifiers rather than extended natural-language instructions. Longer payloads may be truncated before they reach the receiving application.

Encoding is another. Text can pass through multiple representations, including binary data, hexadecimal values, Unicode strings, or format-specific structures. Each transformation introduces an opportunity for the original content to change. Applications may also normalize whitespace, remove unsupported characters, decode encoded data, or convert input into a predefined identifier format.

For researchers, these transformations should be measured rather than assumed.

A practical starting point is a short, harmless test string with a distinctive identifier. This allows the researcher to verify whether the receiving application stores the expected canary value before introducing more complex instruction-like content. For example, a controlled test marker such as MG-PI-TEST-001 can be used to trace a value through a scanning workflow without attempting to alter model behavior.

Once the delivery path is understood, researchers can assess whether the same channel supports the length and structure required for a prompt injection payload.

‍

Testing Whether Malicious Content Reaches Its Destination

A central part of Mindgard’s testing methodology is determining whether a payload survives the systems between its original carrier and the eventual AI input. Our research uses the concept of a survival matrix to record what happens to test content at each stage of the delivery process. Rather than treating an attempted injection as a binary success or failure, the matrix tracks whether the content is preserved, modified, sanitized, or rejected.

  • Preserved payloads: Reach the observed destination without meaningful changes and establish that the tested channel can transport the relevant content.
  • Modified payloads: Reach the destination but undergo some transformation which can include truncation, character replacement, encoding changes, or normalization among others.
  • Sanitized payloads: Are handled as potentially dangerous content that is removed or neutralized by an intermediate component.
  • Rejected payloads: Fail to pass an input validation, protocol, or application boundary.

These outcomes help researchers identify where the delivery mechanism breaks and which safeguards affect the attack path. For example, testing may show that a QR scanning workflow preserves an arbitrary text value, while an access-control reader accepts only a constrained credential identifier. Both observations are useful with the first identifying a possible route into downstream operational data and the second demonstrating a restriction that may prevent instruction-like content from entering the system.

For further clarity, the matrix should also record the point at which each outcome was observed. Successful storage in one application does not establish that the same value appears unchanged in an AI model's context.

‍

Building a Repeatable Testing Workflow

A useful physical prompt injection assessment allows researchers to reproduce the delivery path and identify exactly where an unexpected result occurs.

The process begins by selecting an input channel and understanding its normal function. For a QR-based asset management workflow, this means identifying how the label is scanned, which application receives the decoded content, and where the resulting data is stored. The researcher can then generate a controlled payload using an appropriate encoding format. Initially, this should be a recognizable test marker rather than an instruction intended to change AI behavior, resulting in the payload being delivered through the selected physical interface in an authorized test environment.

The next step is verifying storage. A researcher must examine the relevant record or log to determine whether the content was accepted and whether any transformation occurred. If the payload survives, the assessment moves downstream and the researcher must identify whether an AI-connected workflow retrieves the affected information and, where observable, verifies how that information appears in the model's context.

Only after confirming this path does it become meaningful to evaluate whether instruction-like content can influence model behavior. Recording the original input, intermediate representations, and final observed output makes these experiments easier to reproduce and compare across environments.

‍

Interpreting Results and Limitations

Successful delivery should not be confused with successful prompt injection. A payload may survive every physical and software processing stage and still fail to influence the AI system. The model may correctly interpret the content as untrusted data, or application controls may prevent instructions embedded in retrieved records from changing the intended behavior.

Equally, unsuccessful transport experiments do not necessarily indicate that the downstream AI application is secure. They may simply demonstrate that the tested input channel cannot carry the required content.

Our earlier research included unsuccessful access-control reader experiments, illustrating how protocol restrictions and data transformations can interrupt the attack chain before any AI interaction occurs. These negative results provide useful information about the boundaries enforced by existing systems.

For meaningful reporting, researchers should distinguish physical delivery, storage persistence, downstream retrieval, and model-dependent execution as separate findings. This prevents the presence of malicious text in a database from being presented as evidence of a successful AI compromise.

‍

Applying the Tools to AI Security Assessments

Physical prompt injection testing becomes particularly relevant when AI applications consume information from operational systems that were not originally designed as model inputs. Security teams can use Prompt Injection Studio and the Flipper Zero Field Kit to investigate how physical and device-generated data enters these environments.

The resulting assessments can help identify which input channels accept attacker-controlled text, how that information is transformed, and whether it remains available to downstream AI applications.

‍

‍

This approach also supports more targeted testing. Rather than beginning with a model and searching for a successful prompt, researchers can begin with a real operational workflow and map the data path toward the AI system. That mapping helps identify which components require closer inspection, including input validation, database fields, retrieval logic, prompt construction, and agent permissions. It also provides a basis for regression testing. Where a previously accepted payload becomes rejected or sanitized after a system change, researchers can verify whether the relevant boundary is behaving as expected.

‍

Closing Perspective

Physical-world prompt injection requires researchers to look beyond the model interface and examine the systems responsible for supplying AI with data. A malicious instruction is only useful to an attacker if it can reach an environment where it may be interpreted and acted upon. Physical interfaces, operational databases, and data-processing pipelines all influence whether that happens.

Prompt Injection Studio and the Flipper Zero Field Kit provide resources for investigating these delivery channels and developing repeatable tests around them. The broader objective is to understand the entire attack path, including where content enters, how it is transformed, whether it persists, and when it becomes accessible to AI.

As organizations connect more physical and operational systems to AI-driven workflows, these testing methods will become an important part of evaluating the trust boundaries between collected data and automated behavior.

ATTACKER-ALIGNED AI SECURITY

Talk to Our AI Security Experts

We found vulnerabilities in AI from OpenAI, Meta and AWS. See how Mindgard finds and proves the weakness attackers could exploit in yours.

✖