My agent said something it shouldn't have

Microsoft Developer uses Sparkles, a cupcake-store agent, to demonstrate where guardrails intervene when an attacker tries to override its instructions. The walkthrough covers direct user attacks, instructions hidden in tool responses, and tests for business-rule bypasses and sensitive-data exposure.

Two routes for prompt injection

The demonstration uses two versions of the same attack:

These attacks enter through different parts of the agent’s workflow. The first comes from the user; the second arrives inside information returned by a tool.

Configure and assign a guardrail

The walkthrough creates a custom guardrail in Microsoft Foundry and attaches it to the agent. It enables Prompt Shields for both user input and indirect attacks in tool responses.

The configuration segments also cover content safety and protection of personal information. Together, these controls address the need to keep the agent on task while checking what it receives and how it responds.

Replay attacks and inspect traces

After assigning the guardrail, the presenter replays both prompt-injection attempts. In the demonstrated tests, the guardrail blocks the attacks before the agent acts, and the trace identifies where each protection intervenes.

The key distinction is the intervention point:

The walkthrough also tests business-rule bypasses, voucher and data exposure, and safety violations. These scenarios extend the checks beyond staying on topic to whether the agent can be pushed into unauthorized behavior or disclosure.

Resources