NNYK / BLUEPRINTSAI SYSTEMS EXPLAINED
SYSTEM BLUEPRINT / 02 · HOSTED FASTAPI / DEMO ADAPTERS

AgentGate.

A security checkpoint between an AI agent and its tools. AgentGate is a hosted Python/FastAPI prototype that validates agent tool requests against a small allowlist, checks selected patterns, enforces simple limits, and requires a one-use approval for a sensitive demonstration action.

Railway backend · Live policy inspectionFastAPI · Pydantic · HMAC · Docker19 automated tests
01 / START HERE

What is it, really?

An agent with unrestricted tool access could request unexpected actions or leak sensitive text. This prototype puts predictable checks between a request and two fixed demonstration tools.

IN EVERYDAY LANGUAGE

Picture an office reception desk. It checks who's allowed in, what they are asking to do, whether a manager's permission is required, and what sensitive details should be hidden. AgentGate is a small software version of that checkpoint.

WHO IT HELPS

The practical use case

An agent with unrestricted tool access could request unexpected actions or leak sensitive text. This prototype puts predictable checks between a request and two fixed demonstration tools.

WHAT YOU CAN VERIFY

Hosted demo API

Public source code, architecture documentation, tests and the labeled browser demo are linked below. The implementation boundaries are documented, not hidden.

02 / INTERACTIVE BLUEPRINT

Follow the architecture.

Select any stage below. The explanation shows what enters that part of the system, what it does and what comes out. This diagram explains real code architecture; it is not connected to the running backend.

IN FOCUS / Step 1 of 5

Authenticate

The FastAPI endpoint checks the X-API-Key header against the server-side client credential. The approval and audit endpoints require a different administrator key.

WHAT GOES INA tool request plus client credential
WHAT COMES OUTAuthenticated request or HTTP 401
Tip: use ← → arrow keys while a stage is focused.

The visual flow is an educational representation. For the exact code paths, open the source and engineering documentation.

03 / WALK THROUGH A QUESTION

What does it look like?

These simplified examples are drawn from the repository's documented behavior. They explain what to expect; they do not execute an API request from this page.

EXAMPLE INPUT

What you provide

POST /tools/call
X-API-Key: <server-issued client key>
{
  "session": "demo",
  "tool": "search_docs",
  "arguments": {"query": "onboarding"}
}
EXAMPLE OUTCOME

What the system determines

{
  "decision": "allow",
  "result": {
    "matches": [{"title": "Operations handbook", "...": "..."}]
  }
}

send_notification requires a request-bound one-use admin approval first.

Illustrative, simplified shape; the real endpoint also returns sanitized arguments and a call count. The adapter uses fixed demonstration data—no email or notification is actually sent. Never put client or admin keys in frontend JavaScript.

04 / WHY THE TECH EXISTS

Every component has a job.

Instead of a giant list of tools, these are the actual responsibilities each technology has in this project.

FastAPI

Receives authenticated tool calls and exposes health and documentation.

Pydantic

Validates request models and basic field constraints.

HMAC / SHA-256

Binds one-use approval tokens to exact request data.

Regex + Python lock

Handles simple policy patterns, redaction and process-local state.

05 / OPEN THE EVIDENCE

Show the working parts.

✓ Implemented

  • Client and administrator authentication are separated.
  • Only two named demo tools are allowlisted.
  • Approval tokens are request-bound, one-use and time-limited.
  • Redacts selected email/key patterns in nested values and outputs.
  • Hosted /health and /docs are publicly checkable; protected endpoints require credentials.

○ Not claimed

  • The two adapters are simulated; send_notification does not send a real message.
  • Pattern checks are not robust against obfuscated, multilingual or indirect prompt injection.
  • Session counts, approvals and audits live in one server process and reset on restart.
  • The caller selects the session string, so per-session caps are not robust tenant quotas.
  • No general MCP proxy, production security certification or full denied-event audit.
06 / QUESTIONS THAT MATTER

Understand the trade-offs.

COMMON QUESTION

Does it actually send notifications?

No. The notification adapter returns a simulation flag and does not send a message.

COMMON QUESTION

Can I try the live endpoint without a key?

The health endpoint and Swagger documentation are public; protected tool operations correctly reject missing credentials.

COMMON QUESTION

Can it stop every prompt injection attack?

No. It implements a limited set of checks, not a complete agent security system.

Being clear about limitations is part of engineering: the project shows patterns and testable code, not a promise of production security, measured cost reduction or unconfigured model inference.

07 / KEY WORDS

No jargon left behind.

Allowlist
A short list of tool names that the system permits.
Approval token
A short-lived permission tied to one exact tool request.
Redaction
Replacing selected sensitive text with safe placeholders.
Audit metadata
A record of what was allowed without copying raw arguments.