AI guardrails check every request before it leaves.

SecondGuard, the guardrails in SecondStack, checks the requests that people, agents and apps on API keys send to AI models. It runs on your own servers and masks, blocks or logs personal data and secrets by the rules you set.

Masked on the way out, restored on the way back.

The provider receives a placeholder where each card number or email address stood, and SecondGuard puts the real values back into the answer before the person reads it. The same value always gets the same placeholder, so a long conversation stays coherent.

SecondGuard · @finance-analystvia SecondGate
SENT TO THE PROVIDER

Approve invoice 4471 from Meridian Legal, paid by card [CARD_1], contact [EMAIL_1], amount $12,300.

RETURNED TO THE PERSON

Approve invoice 4471 from Meridian Legal, paid by card •••• 4455, contact j.ortiz@meridian.example, amount $12,300.

What SecondGuard looks for.

A guard is one check with one action. SecondGuard ships with more than 300 built‑in pattern rules for personal data and secrets, and you add guards for the names and terms specific to your company.

Personal and financial data

Pattern rules find email addresses, card numbers, IBANs and IP addresses. Machine‑learning recognition adds names, phone numbers, locations and government IDs such as US Social Security numbers. It works in six languages and stays switched off until you turn it on.

Secrets and credentials

Pattern rules know the formats of API keys, tokens, passwords, private keys and database connection strings. A statistical check finds secrets in formats no rule knows, and a second stage confirms each candidate before the guard acts.

Your own rules

List exact terms such as internal hostnames or project names. Write a policy in plain words, and a model you trust checks each message against it. A similar check judges an attached image or document. Your team can deploy detectors written in Python.

Where it runs, and what happens on a hit.

SecondGuard sits in front of SecondGate, the LLM gateway, on your own servers. Every call from chat, agents, coding sessions and API keys passes through it on the way out, and a file uploaded in chat is checked before anyone can use it.

block

The request stops before it reaches the provider, and the person sees a block notice in the chat. Use it for content that should never leave your servers.

mask

SecondGuard replaces each matched value with a placeholder such as [CARD_1] before the request leaves and puts the real value back into the answer. The chat shows the person where values were masked and restored.

log

The request goes through unchanged, and the finding goes on the record. Use it to measure what your traffic contains before you enforce a rule.

When several guards match one request, the strictest action wins: block over mask, mask over log. For each guard you also choose what happens if the guard itself fails: stop the request or let it through.

Administrators set the rules in ControlTower.

Administrators write each guard in ControlTower, the admin console, and bind it to one model, to a model tag such as external models, or to every model. They test a guard on sample text, add validation tests that stop a bad deploy, and can start with every guard in observe‑only mode.

ControlTower · Guardrails6 guards
GUARDTYPEMODELSON A HIT
Card numbers and IBANs Pattern rules External models mask
API keys and tokens Pattern rules All models mask
Unknown secrets Entropy All models mask
Internal hostnames Word list External models mask
People's names Name recognition External models log
Abusive language Model check All models block

Every hit leaves a record.

Every finding, every block and every guard failure writes a record in your own database. Administrators also get an alert when a guard blocks a request or finds a secret.

ControlTower · Guardrails · Records
Card numbers and IBANsmask
From
Agent · @finance-⁠analyst
On a hit
2 values masked, restored
Text kept
Masked + encrypted original
Kept for
30 days

What a record holds

A record names the request, where it came from, the model, the guard and rule that fired, and the action. ControlTower links it to the person whose key sent the request. Matched values never appear in it in plain text.

How much text it keeps

Your administrators choose what a record keeps of the message: nothing, the masked text, or the masked text plus an encrypted original. The shipped setting keeps the encrypted original for 30 days.

Access to originals

An administrator who opens an original takes an explicit step, and ControlTower records that step in its audit trail. Counts per guard and per rule link to the records behind them.

Questions about AI guardrails.

Does SecondGuard check the model's answers?
No. SecondGuard checks what goes to the model: prompts, uploaded files, the conversation history and tool results sent along with a request. It processes an answer only to put the masked values back, and it does not filter what the model wrote.
Does masking break the answer or an agent's tools?
No. The model works with a placeholder such as [EMAIL_1], and SecondGuard restores the real value in the answer. Streamed answers are restored the same way. The same value gets the same placeholder across requests, so a conversation stays coherent and provider prompt caches keep working. When an agent passes a placeholder into a tool call, the tool receives the real value.
How do we roll out guardrails without breaking work?
Start in observe‑only mode: one switch makes every guard log its findings and change nothing, so you see what your own traffic contains. Replay sample text through a guard before you deploy it. Then write validation tests that say which text must trigger which guard, and a failing test refuses the deploy. The guard set that ships is a starting point for demonstrations, and each company sets and tests its own policy.
Which part of LLM security does SecondGuard cover?
The data that prompts, files and agent traffic carry to a model provider: personal data, credentials and anything else your rules name. This is data loss prevention for AI requests, and it is built for accidental and careless disclosure. SecondGuard does not defend against prompt injection, and it will not stop a person who deliberately splits or encodes a value to get past a rule.
Do our apps need code changes to be covered?
No. Once an app calls its models through SecondGate, the LLM gateway, SecondGuard checks its requests like any other traffic: chat, embeddings and image generation on OpenAI-, Anthropic- and Gemini-compatible endpoints. A clean request and its answer pass through unchanged. Audio sent for transcription is not checked today.

See one request get checked, masked and recorded.

Bring a prompt your team would really send and put made‑up values in it. On the demo call we run it through SecondGuard and show what the provider receives, what the person gets back and what the record keeps.

See the LLM gateway that carries every call