Security for the write side of your site
Open to read. Priced to write.
AI agents are cheap to run and getting cheaper. Most of them only read, and that is fine. The ones that write fill your comment sections and grind your login page. Attackfee puts a small cost on every write. Reading stays free, including your docs and read APIs.
- Reads stay free. Page views are never gated.
- Writes carry a cost. A person pays it once a visit, in the background.
The cheap side of your site is the side that writes
Every public website has two halves. The read half serves pages, docs and API responses. It is built to be cached and crawled, and agents reading it is how people find you now.
The write half is small and fragile. A comment, a signup, a login attempt or a posted search query each cost you something real: a row in a database, a moderator's minute, a call to a paid search backend, a locked account. On most sites these routes cost the sender nothing at all. An agent can hit them ten thousand times before anyone looks at a dashboard.
Attackfee changes the price of the write half and leaves the read half alone.
How it works
- You mark the routes that change something. Comments, contact forms, signups, logins, posted search and write APIs. Each route gets a class: search, write, account or admin. A heavier class asks for more work. Anything you leave unmarked that is a GET stays a free read.
- A visitor's browser does a little background work. While someone reads or types, the page script does a short proof of work and trades it with your server for a pass. There is nothing to solve and nothing to click.
- The pass rides along with the post. Pressing Send just sends. One pass covers 20 actions for 15 minutes, so a person pays about once per visit.
- A write without a valid pass is refused. The server answers 403 and includes a fresh challenge.
- Volume pays again and again. A script has to earn a new pass every 20 actions. Ten thousand login attempts means earning 500 passes, each with its own round of work.
In the repo's benchmark the median check on a desktop took about 0.2 seconds, and about 0.4 seconds on an emulated phone. No real phone has been measured yet. If the work ever runs past 8 seconds, the page shows a "Verify before sending" button instead of waiting.
What stays open
Agents are welcome to read. Attackfee is built so that reading never costs anything.
- Every GET, HEAD and OPTIONS request is a free read unless you deliberately mark that route otherwise.
- The Node server refuses a config that gates page views unless a separate setting confirms you meant it. The edge worker and the WordPress plugin never gate a GET.
- Attackfee does not block crawlers and does not charge for reading.
- Agents can find out how to write before they try. Each Attackfee site serves a machine-readable description at
/.well-known/attackfee.json, free and unchecked.
What carries a cost
You decide which routes count and how heavy each one is. The four classes, from light to heavy:
- Search: a search box that sends its query as a form post. 1x work.
- Write: comments, forms, votes and other posts. 4x work. Any POST you have not mapped counts as a write.
- Account: signup, login and password reset. 8x work.
- Admin: staff actions. 16x work.
A pass earned for a heavier class also covers the lighter ones.
For sites that see GPU-backed grinding, there is an optional memory-hard mode that is much harder to speed up on graphics cards. It is off by default because it is heavier on phones.
For agents
An agent that writes to an Attackfee site has a predictable path. It sends the Attackfee-Client: agent header and gets JSON back instead of an HTML page. When a write needs a pass, it does the same work a browser does and retries.
- Agent SDK.
@attackfee/agentdoes the work for a write and retries once. - MCP server.
@attackfee/mcpruns on the agent's own computer. It reads a site's/.well-known/attackfee.jsonand calls only that site's/v1API. It has no service of its own.
Paying per action over HTTP 402 instead of doing the work is built into the code and switched off. No Attackfee site takes payment today, and there is no price list. If a site owner turns it on later for their own copy, the owner decides which routes cost more by choosing their class.
Privacy
Attackfee prices actions without needing to know who sent them.
- The page script never reads or sends what people type into your forms.
- Checks run on your own server. Nothing about a visitor is sent to us or to any third party.
- No tracking pixels and no third-party cookies. A pass lives in memory or in one first-party cookie,
attackfee_pass, that lasts 15 minutes. - No IP blocking. Your server does limit how often one network address can ask for new challenges, 60 a minute by default, to protect itself.
- Logs leave out form bodies, cookies, passes and IP addresses.
Limits
Security copy that skips this part is not worth reading, so here it is.
- A funded attacker can still get through. Proof of work is cheap on rented GPUs. Attackfee makes every try cost something and makes volume slow, but someone willing to spend can keep going.
- It does not filter network floods. Attackfee works at the request level on the routes you mark. Volumetric attacks need your host or network provider.
- It does not identify anyone. There is no bot score and no verdict about who is a person.
- It fails closed. If the store that tracks used challenges is down, protected writes get a 503. Nothing gets through unchecked.
- WordPress gaps. The plugin covers comments and the wp-login.php form by default, with registration, lost password, the classic WooCommerce checkout and Contact Form 7 as options. It does not cover the WooCommerce block checkout, XML-RPC or application passwords.
Where it runs
- Node:
@attackfee/server, with Express middleware and the/v1API. MIT. - PHP: a library that checks passes, shipped inside the WordPress plugin. GPL-2.0-or-later.
- WordPress: a plugin you upload from the Download page. GPL-2.0-or-later.
- Edge: a worker build in the repo. It runs this site and its demo.
The packages are not on npm yet. Today you install them from a copy of the repo.