Skip to content
AdGate, open source, pre-alpha

Ads in AI chat, decided by policy and proven on the record.

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.

The record, verifiedEd25519

POST /v1/evaluate

  • turn_7serveSponsored, after the answer
  • turn_8suppresssensitive_category:health
  • turn_9suppresspaid_user

GET /v1/verify/aud_01J9QX

valid
true
schema
ok
record_hash
ok
chain
ok
signature
ok
creative_hash
ok
disclosure_present
ok
separation_attested
ok
Seven checks anyone can run against the record with the app’s public key. Nothing here trusts the gateway.

Built to fail closed.

An ad that should not have shown is far worse than a missing ad. Every default leans that way.

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.

Policy as code

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.

Labeled, after the answer

The slot is its own block below the reply. The SDK refuses to render inline, and the record carries the proof.

A signed record per turn

Hash chained and signed with Ed25519. Advertisers and auditors verify it with the public key, without trusting the gateway.

Self hosted, Postgres only

One service next to your app. No Redis, no queues, no vendor to depend on. Apache 2.0.

Not an ad network. A gate for the demand you already have.

AdGate mediates between your sources. It does not sell inventory and it takes no cut.

Direct sponsors

Your own catalog of creatives, with targeting and competitor exclusions.

Affiliate accounts

Links built with your own affiliate accounts. You keep the commission.

Network adapters

A plug-in interface for ad networks, shipped as partner APIs are confirmed.

Integrate in an afternoon.

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.

Python, policy and self-host examples

TypeScript, with the Vercel AI SDK@adgate/sdk
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,
});

How we build.

Three rules, written into the contract docs that the code implements.

The referee is code.

Whether a slot is allowed is decided by a policy file and checks you can read, never by a model judging its own output.

You stay in control.

Requests can only make a policy stricter. Self harm can never leave the blocked list. Paid users never see ads unless you say so.

Anyone can check the record.

Every decision, including a suppression, is signed and chained. An advertiser or an auditor can verify it without asking us.

Where it stands.

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.

  1. Now

    Hardening the deployment path and the release pipeline. Design partners welcome.

  2. 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.

  3. Later

    Network adapters against real partner APIs, cross-device frequency caps, and an advertiser self-serve portal, once real traffic says they matter.

Get the first release.

One email when AdGate is on npm and PyPI. Nothing else.

Early access and design partnerships: hello@chalkcorner.com. We read everything and answer ourselves.

Who is behind it.

Chalk Corner is a one-person software studio in the Bay Area.

Dileep Kumar Sharma

Dileep Kumar Sharma

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