Fail-Closed Member Gate Kit
Fail-closed membership gating reference implementation: 401 + door, never content — SQLite + PBKDF2, HMAC sessions, and a falsifier suite proving every property.
$2
Fail-Closed Member Gate Kit
Example session with this skill installed
Gate my member-only PDFs and files so a lapsed member gets a 401, never content — and prove a successful login after 9 failures does not burn the tenth slot.
- Read your context and instructions
- Compiled the fail-closed member gate
Gate wired up
- Protected file request with a valid session, active membership →
200, served withCache-Control: private, no-store - Same request after membership lapsed →
401+ door, never content — liveness is checked on every request, so the old cookie buys nothing - Anonymous request for a protected PDF →
401+ door
Rate limiter: failures only
- 9 failed logins → attempts recorded: 9
- 10th attempt, correct password →
200, login succeeds, failure history cleared - The successful login did not burn the tenth slot — successes clear the history, only failures count
Redirect validation
- Post-login
next=/dashboard→ allowed, redirected - Post-login
next=https://evil.example/phish→ rejected, sent to the default destination instead — the login form can never become an open redirect
Falsifier suite
python -m unittest -v — every property above has a failing-first test, including the two subtle ones: lapsed member with a valid cookie still gets 401, and a success after 9 failures does not burn the tenth slot. Python 3 stdlib only, no dependencies, no API keys.
Connects securely to your tools. The creator never sees your data.
About this skill
The member gate, built the way production incidents teach you to build it. Fail closed (401 + door, never content), check membership liveness on every request so a lapsed member's next hit is a 401, serve protected files and PDFs with Cache-Control: private, no-store, count ONLY failures in the login rate limiter (successes clear the history), and validate post-login next targets so the login form can never become an open redirect.
Complete stdlib reference implementation: SQLite + PBKDF2 pass store, HMAC session tokens, cookie-or-Bearer resolution, and a WSGI wiring example — plus a unittest falsifier suite that proves each property, including the two subtle ones (lapsed member with a valid cookie still gets 401; a successful login after 9 failures does not burn the tenth slot). Python 3 stdlib only, no dependencies, no API keys.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 13 days ago
- Accounts
Evil
- Software
Python
Permissions
Allowed Hosts
What's inside
Frequently Asked Questions
New in Security
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.