Fails closed, always
Any error, timeout or low confidence result suppresses the slot and returns a normal response. Your app never sees an exception and your user never sees a broken ad.
AdGate sits between your AI app and any ad demand. For every turn it decides in code whether a sponsored slot is allowed, shows it after the answer and never inside, and signs a record anyone can verify. Self hosted. Postgres only. Apache 2.0.
Which Postgres host should I use for a side project?
POST /v1/evaluate
GET /v1/verify/aud_01J9QX
An ad that should not have shown is far worse than a missing ad. Every default leans that way.
Any error, timeout or low confidence result suppresses the slot and returns a normal response. Your app never sees an exception and your user never sees a broken ad.
One YAML file per app: blocked categories, paid tiers, regions, frequency caps, confidence floors. A request can tighten it for one turn and never loosen it.
The slot is its own block below the reply. The SDK refuses to render inline, and the record carries the proof.
Hash chained and signed with Ed25519. Advertisers and auditors verify it with the public key, without trusting the gateway.
One service next to your app. No Redis, no queues, no vendor to depend on. Apache 2.0.
AdGate mediates between your sources. It does not sell inventory and it takes no cut.
Your own catalog of creatives, with targeting and competitor exclusions.
Links built with your own affiliate accounts. You keep the commission.
A plug-in interface for ad networks, shipped as partner APIs are confirmed.
One client per process, one call per turn, running in parallel with your model. The API key stays on your server. The browser only ever sees the decision.
TypeScript SDK with React and Vercel AI SDK entries. Python SDK for everything else. Agents evaluate once per user goal, not per step.
import { createClient } from "@adgate/sdk";
import { adgateMiddleware } from "@adgate/sdk/ai";
import { streamText, wrapLanguageModel } from "ai";
const adgate = createClient({
apiKey: process.env.ADGATE_API_KEY,
baseUrl: process.env.ADGATE_BASE_URL,
});
// Evaluates in parallel with the model call.
const result = streamText({
model: wrapLanguageModel({
model,
middleware: adgateMiddleware(adgate, {
appId: process.env.ADGATE_APP_ID,
surface: "chat",
getUser: () => ({ tier, region: "US", locale: "en-US" }),
conversationId: () => conversationId,
turnId: () => turnId,
onDecision, // render the slot as its own message part
}),
}),
prompt,
});Three rules, written into the contract docs that the code implements.
Whether a slot is allowed is decided by a policy file and checks you can read, never by a model judging its own output.
Requests can only make a policy stricter. Self harm can never leave the blocked list. Paid users never see ads unless you say so.
Every decision, including a suppression, is signed and chained. An advertiser or an auditor can verify it without asking us.
AdGate is pre-alpha. The gateway, both SDKs, the dashboard, the example apps and the contract docs exist and pass their tests. Nothing is published yet, and the classifier has only been exercised against fixtures, not a live model.
We are looking for a few AI apps to run real traffic through it before the first release. If that is you, write to us.
Now
Hardening the deployment path and the release pipeline. Design partners welcome.
Next
The first public release: the SDK on npm, the Python client on PyPI, the gateway image on GitHub Container Registry, and the repository opens.
Later
Network adapters against real partner APIs, cross-device frequency caps, and an advertiser self-serve portal, once real traffic says they matter.
One email when AdGate is on npm and PyPI. Nothing else.
Want it sooner, or want to be a design partner? Write to us instead.
Early access and design partnerships: hello@chalkcorner.com. We read everything and answer ourselves.
Chalk Corner is a one-person software studio in the Bay Area.

Founder. Software engineer, San Francisco
Dileep builds full-stack and AI products. He was the founding engineer at Metis AI in San Francisco, where he built the company’s web and mobile product from zero, including AI agents with tool calling. He finished a Master of Science in Computer Science at RIT in spring 2026, co-founded an EV charging startup as a student, and has won twelve hackathons.
AdGate came from one question: how do you let a machine act for people without letting it grade its own work? The answer is a referee made of code and a record anyone can check.
Also in the works
Corner, a game where you coach an AI companion and a referee made of code keeps score. Unreleased, built on the same rule. About Corner