---
title: "Discussion on \"My agent kept reading data it wasn't allowed to. The prompt was never going to stop it.\" | Hashnode"
description: "Discussion on \"My agent kept reading data it wasn't allowed to. The prompt was never going to stop it.\". How we stopped handing an AI agent real API keys: one mock key, swapped at the middleware, and enforcement that lives below the model."
url: "https://hashnode.com/posts/my-agent-kept-reading-data-it-wasn-t-allowed-to-the-prompt-was-never-going-to-stop-it/6a43e9f94dca5e489aa2a371"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [My agent kept reading data it wasn't allowed to. The prompt was never going to stop it.](https://abdullahsaad5.hashnode.dev/my-agent-kept-reading-data-it-wasn-t-allowed-to-the-prompt-was-never-going-to-stop-it?utm_source=hashnode&utm_medium=feed)

How we stopped handing an AI agent real API keys: one mock key, swapped at the middleware, and enforcement that lives below the model.

Jun 30 · 13 min read · abdullahsaad5.hashnode.dev  
Read the article

-   [#ai](https://hashnode.com/tag/ai)
-   [#security](https://hashnode.com/tag/security)
-   [#software-development](https://hashnode.com/tag/software-development)
-   [#llm](https://hashnode.com/tag/llm)
-   [#api](https://hashnode.com/tag/api)

## Written by

[Syed Abdullah Saad](https://hashnode.com/@abdullahsaad5)

@abdullahsaad5 · Islamabad, Pakistan

  
[View profile](https://hashnode.com/@abdullahsaad5)

I build AI agents that do real work, not demos. Full-stack (MERN, Next.js) + LLM tooling. Here I write up the hard parts: identity, safety,

I build AI agents that do real work, not demos. Full-stack (MERN, Next.js) + LLM tooling. Here I write up the hard parts: identity, safety, action-selection at scale.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
