- Home
- Skills
- APIs & Backend
- Access-Code Job Intake with Per-Code Quotas
Access-Code Job Intake with Per-Code Quotas
An unlisted intake page is a common shape: you give someone a code, they submit a request and watch it, and you never publish the page.
$29
Works with the AI Agents you already use
Access-Code Job Intake with Per-Code Quotas
Example session with this skill installed
Initialize a new IntakeService for a private report generator. Set a 50MB payload cap and provide a code hash with a daily limit of 5 jobs and 2 in-flight jobs.
- Read your context and instructions
- Compiled the access-code job intake
I have initialized the IntakeService with the requested security parameters and quotas. The service is configured to use atomic file persistence and is ready for integration with your submission routes and job runner.
Service Configuration and Quota Map
import { IntakeService } from './intake.mjs';
import { createHash } from 'node:crypto';
const hashCode = (code) => createHash('sha256').update(code).digest('hex');
// Configuration for the report generator intake
const service = new IntakeService({
dataDir: './jobs-data',
failedCodeLimit: 5,
openAccess: false,
codes: {
[hashCode('beta-user-2024')]: {
id: 'client_01',
dailyJobs: 5,
maxInFlight: 2,
label: 'Beta Tester'
}
}
});
// Example Submission Flow
try {
const ip = '192.168.1.50';
service.requireCode('beta-user-2024', ip);
const job = service.submit('beta-user-2024', reportData, {
contentGate: (data) => data.length < 52428800 // 50MB Cap
});
console.log(`Job created: ${job.id}. Token: ${job.fileToken}`);
} catch (err) {
console.error(`Submission refused: ${err.message}`);
}
Next steps
- Wire
service.requireCodeandservice.submitinto your HTTP POST handler. - Attach your report processing logic to the
service.startProcessing(id)hook. - Set up a
setIntervalto triggerservice.sweepRetention()every hour to clear expired job files.
Connects securely to your tools. The creator never sees your data.
About this skill
An unlisted intake page is a common shape: you give someone a code, they submit a request and watch it, and you never publish the page. The risk is in the details a hand-rolled version gets wrong: codes stored in the clear, no limit on guessing, no per-code quota, and a status endpoint that confirms a job exists to anyone. This service is the front door and the status board done carefully, and it leaves processing to a separate runner.
intake.mjs: requireCode(code, ip) resolves a submitted code to its limits or throws; only sha256(normalized code) is stored, so a leak of the config does not leak the codes, and a per-address limiter refuses an address that sends too many bad codes in the window, so brute force is slowed without locking everyone out. submit(code, payload, { contentGate }) enforces a per-code in-flight cap and daily allowance, a payload-size cap, and an optional content gate that runs before anything is stored, so a refused submission leaves nothing on disk. me(code) and listJobs(code) show a submitter only their own quota, usage and jobs. Each job carries a one-time file token; result(id, token, name) returns a result descriptor only for the right token, compared in constant time, and a wrong token is a 404 so the endpoint cannot be used to confirm a job exists.
Processing is deliberately not prescribed: a runner calls startProcessing, recordProgress, and recordResult or recordFailure, so the intake service composes with any worker or queue. Jobs persist one JSON file each, written to a temp file and renamed into place, and a retention sweep removes finished and aged-out jobs.
Reference: why access codes are hashed and normalized, why the code belongs in the URL fragment and not the query string, how the per-code quotas and the day boundary work, why size and content are refused at the door, and why a wrong result token is a 404. 12 tests. Node 20+, standard library, no network. Access codes are a shared secret, not identity; map each to a person out of band for accountability.
Requires separate worker logic via hooks. No built-in networking; requires integration with a web server. Local file storage is not distributed across multiple nodes.
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 any payment.
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 18 days ago
Requires