AppSec for AI must test whether application code blocks unauthorized data access and unsafe actions even when a model requests them. OWASP’s 2025 prompt-injection guidance says retrieval augmentation does not fully mitigate prompt injection. A convincing model refusal therefore cannot substitute for evidence that the surrounding application enforces its security boundaries.
If you are pursuing cleared application security work, prepare to explain how information moves through an AI-enabled service. A hiring manager can assess that reasoning through a synthetic lab. You do not need a classified dataset or a collection of dramatic jailbreak screenshots to demonstrate useful testing judgment.
- Map the flow: identify users, retrieval sources, model context, outputs, and tool identities.
- Test access first: enforce permissions before protected content reaches the model.
- Verify execution controls: validate outputs and authorize tool calls outside model discretion.
- Keep regression evidence: record the boundary failure, correction, and repeatable assertion.
What does AppSec for AI test beyond model behavior?
Test the application paths that retrieve data, assemble context, render responses, and execute actions. Model behavior testing explores whether inputs redirect the model. Application testing asks whether that redirection can cross an authorization or execution boundary and what prevents it from causing harm.
Draw a simple flow: authenticated user, application server, retrieval service, model, output handler, and connected tool. Label where identities change and where content becomes available to a different component. Include caches, conversation history, and logs if the design uses them.
At each connection, write the security decision in plain language. Which documents may this user retrieve? Which actions may this tool identity perform? Which response fields can select a destination? A box labeled “guardrails” is too vague to answer those questions.
NIST’s AI 100-2 E2025 report, published in March 2025, provides adversarial machine-learning terminology and an attack taxonomy. Use it to describe attacker goals and capabilities. The application diagram still needs to identify the controls you actually inspected; using a taxonomy does not establish that those controls work.
When considering cleared AI security career opportunities, separate the job’s model evaluation tasks from its software security responsibilities. Ask whether the role owns threat modeling, authorization testing, secure integration, or incident investigation. Those responsibilities suggest different portfolio evidence.
How do you test authorization before data enter the prompt?
Use synthetic users with different entitlements and verify that retrieval returns only content authorized for the requesting identity. Inspect the context assembled for the model, not merely the final answer. A response that hides restricted text does not prove the retrieval boundary prevented access.
For a lab, create separate document collections for fictional teams and a shared collection available to both. Give the documents distinctive harmless markers. Then exercise ordinary searches, direct document references, conversation follow-ups, and requests that name a different team.
Record the user identity, requested resource, authorization decision, retrieved document identifiers, and assembled context. Inspect any cache key or conversation lookup used in the path. If a previous user’s answer can be reused, verify that the application evaluates the new user’s access rather than inheriting an earlier decision.
Test access changes as well. Remove an entitlement and inspect a subsequent retrieval attempt and any reused conversation state. Define the expected behavior with the system owner, including which stored information must become inaccessible. This keeps your test tied to the application’s policy rather than assumptions about how all AI services behave.
These checks connect directly to cleared application security engineering: identity propagation, object access, session boundaries, and evidence-based remediation. In an interview, show where enforcement occurred and how you proved that a denied request did not reach the protected resource.
Why should retrieved content remain untrusted?
Retrieved documents may contain instructions supplied by someone who has no authority over the application. Test whether the system treats those instructions as data to analyze or as permission to change its behavior. Retrieval relevance and source identity are different questions from authorization to act.
OWASP’s 2025 Prompt Injection entry describes indirect injection through external content and recommends separating and identifying untrusted material. That separation is useful, but your test should still examine downstream effects. A model might produce the requested malicious instruction without the application permitting the action.
In a synthetic document, include a harmless instruction that conflicts with the user’s task, such as requesting an unauthorized lookup of another team’s test record. Keep the target inside the authorized lab. Observe whether the model proposes the lookup, whether the tool accepts it, and whether the data service denies it.
Report those observations separately. “The model followed an injected instruction” describes behavior; “the application returned another team’s record” describes a demonstrated data boundary failure. If the tool denied the request, preserve that evidence too. It shows which control limited the consequence without implying the injection disappeared.
What should validate model output before execution?
Use application controls appropriate to the destination: validate structured fields, enforce allowed operations, encode displayed content, and avoid constructing executable instructions from free text. Test these controls directly with controlled outputs as well as through model-generated responses.
| Boundary | Suggested lab test | Evidence to retain |
|---|---|---|
| Retrieval to context | Request a record outside the test user’s entitlement | Denied lookup and absent restricted content |
| Model to display | Supply controlled markup to the output handler | Safe rendering in the intended context |
| Model to action | Request a disallowed operation or destination | Tool-side rejection before side effects |
| Approval to execution | Alter the proposed action after approval | Changed action requires a fresh decision |
OWASP’s 2025 Improper Output Handling entry addresses insufficient validation before model output reaches other components. Its mitigations include context-aware encoding and parameterized database queries. Test the actual destination; safe treatment for displayed text does not establish safe handling for a database operation or filesystem path.
A useful demonstration replaces the live model with a controlled response fixture. Send the same proposed action directly to the handler and verify the rejection. This makes the application assertion repeatable even when the model does not reproduce the original behavior on every attempt.
For candidates with web application testing experience using Burp Suite, inspect request and response boundaries in an authorized lab. Explain the application state, authenticated user, and downstream result. A proxy capture supports the finding only when it connects to what the service actually permitted.
How should you test tool permissions and sensitive actions?
Inspect the identity used by each tool and attempt operations outside its intended scope. Require the downstream service to enforce authorization regardless of the model’s explanation. For sensitive actions, test that approval covers the specific operation and cannot be reused for a materially changed request.
OWASP’s 2025 Excessive Agency entry recommends downstream authorization, minimal tool permissions, and human approval for high-impact actions. Apply those ideas to a concrete capability. A tool intended to read records should not gain unrelated write authority merely because its connector supports it.
Use a fake action sink for portfolio work. Record proposed actions without sending messages, changing production records, or contacting external recipients. Verify the requested resource, operation, destination, user identity, tool identity, and approval status before the fake action is accepted.
Keep useful event links between retrieval, model invocation, approval, tool request, and outcome. Avoid indiscriminately logging complete prompts or credentials. In a cleared environment, use the program’s approved telemetry handling procedures; a debugging need does not establish permission to move sensitive content into another system.
How do observed failures become regression tests?
Convert the failure into an explicit assertion about application behavior, then rerun it after the fix. Preserve model behavior tests alongside deterministic checks of the affected authorization or output handler. Each contributes evidence about a different part of the system.
A concise finding states the prerequisite identity, attacker-controlled input, boundary crossed, observed effect, and corrective change. Include a permitted baseline so the fix can be checked for unnecessary breakage. If the evidence shows only a proposed action, say that execution was not demonstrated.
Retain the relevant application revision, model identifier, configuration, retrieval corpus version, and test setup. Those details help explain why a result changed. They also prevent a portfolio claim from implying that a successful local test establishes security across other models, tools, or deployed environments.
Assign the corrective work to the component that failed. A retrieval filter defect belongs with the retrieval implementation; an overly broad connector permission needs an identity or integration change. Rewriting the system prompt may affect model behavior while leaving either application weakness intact. Document the reason for the chosen fix.
When discussing your work, lead with the enforced boundary and observed result. Then explain the adversarial input and the limits of the test. That order gives an interviewer a clear basis for evaluating your engineering judgment.
Frequently Asked Questions
Does retrieval augmentation prevent prompt injection?
No. OWASP’s cited prompt-injection guidance says it does not fully mitigate that vulnerability. Test retrieved content as a possible instruction source and verify the surrounding access and execution controls, even when retrieval improves the relevance of ordinary answers.
Is model red teaming still useful?
Yes. It can reveal ways inputs redirect behavior and help identify risky application paths. Pair it with tests that show whether the application permits unauthorized retrieval, unsafe rendering, or disallowed tool actions. Neither evidence set should be presented as a substitute for the other.
Can I demonstrate these skills without sensitive data?
Yes. Use fictional users, documents with harmless markers, and fake tool destinations. Make the access policy explicit and record allowed and denied behavior. Explain that the exercise demonstrates your testing method rather than experience operating a cleared production service.
What should I build first for an AI AppSec portfolio?
Build a small document assistant with separate user entitlements and a simulated action tool. Choose a denied retrieval or tool-action case, document the expected boundary, and preserve the failing result, corrective change, and repeatable regression check together.
