Skip to content
RED SAGSkills
hardPrompt Engineer interview question

You are building an agent that reads emails and web pages and can send messages and update a CRM. How do you protect it from indirect prompt injection?

What the interviewer wants to hear

  • Assume prompts alone cannot stop injection
  • Least privilege and scoped credentials for tools
  • Human confirmation for sensitive or irreversible actions
  • Isolate untrusted content and limit data flows out
  • Detection, logging and red-team testing

Model answer

I start from the assumption that any text the agent reads may contain instructions, and no prompt can reliably make the model ignore them. So the main defences are in the architecture. Tools get least privilege: scoped credentials, read-only by default, and allowlists for recipients and domains. Sensitive actions such as sending external messages, changing records in bulk or sharing data require user confirmation showing exactly what will happen. I block common exfiltration paths, like rendering external images or links built from private data. Where possible, a step that reads untrusted content cannot also take high-risk actions in the same flow. I still mark untrusted content clearly in the prompt and add injection classifiers as extra layers. Finally, I log tool calls, alert on unusual patterns and red-team the agent with known injection techniques before and after launch.

Can you answer it under time pressure?

Take a timed hard round and get scored on every answer.

Start mock interview

More hard Prompt Engineer questions