cors.sh AGENTS.md

Repository-specific instructions for coding agents and developers working on cors.sh, a CORS proxy service. CORS is a browser security mechanism that controls which websites may call another website.

In plain words
What is it for?
Understanding the repository, following its stack and invariants, running checks, and preparing changes before committing.
Why use it?
It records the project’s architecture, required commands, important rules, and sources of truth before code changes are made.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/gridaco/cors.sh/agents-md
Clone the repo
git clone --depth 1 https://github.com/gridaco/cors.sh

Made for: Codex, OpenCode.

Per session 827 This file is loaded in full into every session.
When invoked 827 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00827 $0.00827
Opus 5 $0.00413 $0.00413
Sonnet 5 $0.00165 $0.00165
Haiku 4.5 $0.00083 $0.00083

Measured 2d ago against content hash 7aa015e2fa48, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cors.sh AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 56 lines

How it starts

The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

Guidance for AI coding agents (and humans) working in this repo. CLAUDE.md is a symlink to this file.

What this is

cors.sh — a CORS proxy SaaS, rebuilt on Cloudflare Workers with its own accounts and billing. Two planes:

  • Data planeworkers/proxy: the proxy itself. KV-only on the hot path (origin-pinned key auth, CORS rewrite, streaming + byte metering, monthly quota, test_ rate cap, keyless anonymous tier).
  • Control planeweb/: a Next 16 app on OpenNext/Cloudflare that owns state in D1 and projects key entitlements into KV for the proxy to read. Also the marketing site, console (account = user), Auth.js sign-in, and Stripe billing.

The KV KeyRecord is the contract between the planes — one builder in web/lib/control, reused by project CRUD and billing re-projection. Change it in one place.

SPEC.md is the source of truth for behavior — read it before touching proxy/auth/billing semantics. DEVELOPMENT.md is the setup/run/test guide. GRAVEYARD.md records what the rebuild removed (and why).

Stack and invariants

  • Node ≥ 22 (nvm use), pnpm 10.4.1, turbo monorepo, TypeScript strict.
  • Hosts on Cloudflare only — Workers + D1 (cors-control) + KV (cors-keys). Not Vercel (legacy Vercel projects are disconnected).
  • Secrets are runtime-only — Cloudflare secret bindings in prod, gitignored .dev.vars / .env locally. Never commit a secret.
  • Formatter is oxfmt (not prettier) — config in .oxfmtrc.json.

Commands

pnpm install
pnpm stack:up        # full local stack: web + proxy + mock + page on a shared D1/KV (see DEVELOPMENT.md)
pnpm stack:down
pnpm test:e2e        # self-contained Playwright suite (stack up -> test -> down)

pnpm format          # oxfmt (write)
pnpm format:check    # oxfmt --check   (CI)
pnpm lint            # eslint          (CI)
pnpm check-types     # tsc --noEmit    (CI)
pnpm build           # turbo build

Read the full file on GitHub · 56 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 56 lines · 827 tokens per session scan A 7aa015e2fa48

Subscribe to this mod's changes

cors.sh AGENTS.md is an instructions file published in the GitHub repository gridaco/cors.sh (238 stars, last pushed 2mo ago), licensed MIT. It adds 827 tokens to every session, about $0.0041 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.