Filtering inputs and limiting access to prevent prompt injection in AI agents

Securing an AI assistant against prompt injection requires checking external data inputs before they reach the LLM and restricting the agent's system access.


Cole Medin relies on a two-part defense strategy to secure his AI second brain against rogue commands: filtering incoming data before it reaches the underlying large language model (LLM), and restricting the AI's permissions so it can only access the systems it strictly needs.

As AI assistants shift from passive chat interfaces to active systems connected to business tools, email accounts, and web browsers, they routinely process external data from untrusted sources. That data—such as an incoming document, a web page, or an email—can contain hidden text designed to hijack the assistant's instructions, a security vulnerability known as prompt injection. If an assistant processes a malicious file that tells it to forward private notes or alter system settings, an unprotected assistant will simply obey the hidden instructions.

To counter this, Medin isolates the core language model behind safety checks and limits the assistant's operational boundaries. Describing his setup, Medin explains:

"Because of this, I have a lot of security checks built into my second brain for everything that comes in before it reaches the actual LLM. And of course, I limit its access to the things it actually needs."

This architecture is designed for anyone operating a personal AI assistant or digital second brain connected to external data and business tools. The risk matters directly to anyone integrating AI into their daily workflow: when an assistant holds permission to act across connected software, a single poisoned input can trick it into executing unauthorized actions across your systems.

Filtering data upfront ensures that incoming text is inspected or sanitized before the primary AI model reads it. Limiting system permissions ensures that even if a prompt injection bypasses the initial checks, the assistant lacks the access required to touch sensitive applications or execute destructive changes.

This approach is shipping and actively in use today, rather than being an abstract idea. However, implementing dedicated input filters and granular access controls currently requires deliberate technical configuration. Medin does not detail the specific software tools, filtering rules, or extra processing time involved in running these pre-check layers. For non-developer readers using ready-made consumer AI applications, applying these controls directly can be difficult, as many commercial platforms bundle tool permissions together and offer limited visibility into how they inspect incoming data.

securityautomationvideo
Source: youtube.com