Securing Enterprise LLMs: Prompt Injection Defense & PII Masking with Model Armor on GCP

How an inline filter like Vertex AI Model Armor protects an LLM-powered agent from prompt injection and PII leaks — and why the human review work around it doesn't disappear, it just moves.

The short answer: you protect an enterprise LLM from prompt injection and PII leaks by putting an inspection layer between the user, the model, and anything the model is allowed to touch — checking prompts and responses before either one reaches a database, an API call, or a customer. On Google Cloud, Vertex AI Model Armor is Google’s product for this purpose. I haven’t run it in production myself, so treat the specifics below as a starting point for your own evaluation, not a verified spec.

Why prompt injection got scarier

A prompt injection attack used to mean a chatbot said something embarrassing. That’s a bad look, but it’s contained. Once an agent has real tool access — it can query a database, send an email, place an order, update a record — the same trick that used to produce a weird sentence can now trigger a real action. The model isn’t just generating text anymore, it’s the thing deciding what your systems do next. That’s the shift that makes inline inspection worth building, not a nice-to-have.

What an inline filter is trying to solve

The general pattern behind products like this is straightforward even if the implementation details are Google’s to document, not mine to restate secondhand: something needs to look at what goes into the model and what comes out of it, rather than trusting either by default. Check Google’s own documentation for exactly what Model Armor inspects and how, before you design a system around it.

Treat the model itself as untrusted middleware. It will follow instructions embedded in a document, an email, a web page, or a support ticket just as readily as it follows your system prompt. Whatever filter you put in place, its job is to catch the cases where that’s a problem before the output reaches a person or another system.

PII masking is a separate job from injection defense

Blocking a jailbreak and redacting a social security number are different problems that happen to sit in the same pipeline. Injection defense is about intent — is this input trying to hijack the model’s instructions? PII masking is about content — does this output contain something that shouldn’t leave the system, regardless of how it got there. An agent can produce a PII leak with no injection attempt involved at all, just by summarizing a document that contains sensitive data. Both checks need to run on every response, not just the ones that look suspicious.

A filter is a layer, not a fix

Inline inspection catches known patterns. It won’t catch every novel jailbreak, and it won’t know that a piece of text is sensitive in your specific business context unless you’ve told it what to look for. Treat it as one layer: log what gets flagged, review the edge cases, and feed what you learn back into your detection rules and your system prompts. A filter you set up once and never revisit degrades the same way any other unmonitored system does.

The part that doesn’t automate away

This is where the work actually moves, not disappears. The manual, page-by-page review that used to catch a bad output after the fact gets replaced by the filter for volume — but someone still has to decide what counts as sensitive in your business, tune the rules when the filter is wrong in either direction, and handle the flagged cases that need a real judgment call. That work is more interesting than the review job it replaces, and it requires someone who understands both the business and the guardrails, not just one or the other. If your team’s role was catching bad outputs by hand, the opportunity here is moving up a level — into defining the policy the filter enforces, not competing with the filter on volume.

If you’re building agents that touch real operational tools and customer data, this is squarely inside what I do with custom autonomous agents — purpose-built AI agents that handle research, operations, and customer work around the clock. Getting the guardrails right before you plug in real access is part of the AI strategy and integration work — practical roadmaps for putting LLMs, agents, and automation into real products and workflows.