OpenErrand: user-agent rule, captcha solver policy, reference runner note

Anthony's answers on #227 ("go with your recommendations"):

- Rule 11: a runner may run headless with a normal desktop browser user agent
  (dropping HeadlessChrome) and nothing more: no fingerprint spoofing beyond
  the UA string, no stealth plugins, no solving or evading a bot challenge.
  A challenge the browser completes itself is a wait step; any other is a
  captcha gate.
- Captcha solvers: new site.sector and captcha step `solver`
  (forbidden by default | allowed). Never allowed on government, tax,
  financial, healthcare or identity-provider sites, nor on any errand with a
  declare or identity-proofing step or a secret input; elsewhere only when the
  file says so, with every use logged. The validator rejects `allowed` in the
  forbidden set or without a stated sector; six new tests. The FTB example
  states sector "tax".
- Reference runner: @logicsrc/openerrand / `logicsrc errand run`, marked in
  progress; ftb stays the runner the example was taken from.
- Name stays OpenErrand; family stays Agents and process.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Anthony Ettinger 2026-10-04 15:22:54 +00:00
parent 41d0c59a74
commit c9104a7a36
8 changed files with 79 additions and 17 deletions

View file

@ -65,6 +65,35 @@ describe("OpenErrand", () => {
errorAt(f, keyword, path);
});
const commercial = () => ({
...JSON.parse(blocks[0]!),
site: { name: "Example", sector: "commercial", origins: ["https://example.com"], start: ["https://example.com/contact"] },
steps: [{ id: "form", kind: "page" }, { id: "robot-check", kind: "captcha", match: { selector: "iframe[src*=captcha]" }, solver: "allowed" }]
});
it("allows a declared captcha solver on a commercial errand with nothing sensitive", () => {
expect(validate("openerrand", commercial())).toMatchObject({ ok: true });
});
it.each([
["a solver on a tax site", (f: any) => { f.steps.push({ id: "robot-check", kind: "captcha", match: { selector: "iframe" }, solver: "allowed" }); }, "/steps/5/solver"],
["a solver on an errand that does not state its sector", (f: any) => { f.steps.push({ id: "robot-check", kind: "captcha", match: { selector: "iframe" }, solver: "allowed" }); delete f.site.sector; }, "/steps/5/solver"]
])("rejects %s", (_, mutate, path) => {
const f = fixture();
mutate(f);
errorAt(f, "captchaSolver", path);
});
it.each([
["a secret input", (f: any) => { f.inputs = { password: { type: "string", sensitivity: "secret", sources: [{ from: "prompt" }] } }; }],
["a declare step", (f: any) => { f.steps.push({ id: "attest", kind: "declare", statement: "i declare", why: "Yours to say." }); }],
["a government site", (f: any) => { f.site.sector = "government"; }]
])("rejects a captcha solver on a commercial errand with %s", (_, mutate) => {
const f = commercial();
mutate(f);
errorAt(f, "captchaSolver", "/steps/1/solver");
});
it("allows public inputs and built-ins on a card", () => {
const f = fixture();
f.handoffs["pin-letter"].steps.push("Corporation {{corp_id}} at {{site.name}}: {{errand.title}}");

View file

@ -9,8 +9,9 @@ type Source = { from: string; input?: string };
type Input = { type: string; sensitivity: "public" | "personal" | "secret"; role?: string; sources: Source[] };
type Action = { text?: string; gate?: string; choose?: string; answer?: string };
type Rule = { do: Action };
type Step = { id: string; kind: string; rules?: Rule[]; handoff?: string; resume?: string };
type Step = { id: string; kind: string; rules?: Rule[]; handoff?: string; resume?: string; solver?: string };
type Errand = {
site: { sector?: string };
inputs?: Record<string, Input>;
rules?: Rule[];
steps: Step[];
@ -22,6 +23,9 @@ type Errand = {
/** Step kinds a runner must hand to a person. */
export const GATE_KINDS = ["declare", "identity-proofing", "code", "mail", "captcha"] as const;
/** Sectors where a captcha solver is never allowed. */
export const NO_SOLVER_SECTORS = ["government", "tax", "financial", "healthcare", "identity-provider"] as const;
/** Names a hand-off card may use: none of them is a person's data. */
export const HANDOFF_BUILTINS = ["expires_on", "errand.title", "site.name"] as const;
@ -118,6 +122,21 @@ export function validateOpenErrandReferences(data: unknown): ErrorObject[] {
checkTemplate(download.to, `/outputs/downloads/${i}/to`);
});
// A captcha solver is allowed only where nothing sensitive is at stake: a
// stated sector outside the forbidden set, no attestation, no identity
// proofing and no secret input.
const sensitive =
errand.steps.some((step) => step.kind === "declare" || step.kind === "identity-proofing") ||
Object.values(inputs).some((input) => input.sensitivity === "secret");
const sector = errand.site?.sector;
errand.steps.forEach((step, i) => {
if (step.kind !== "captcha" || step.solver !== "allowed") return;
const path = `/steps/${i}/solver`;
if (!sector) report("captchaSolver", path, "an errand that allows a captcha solver states its site.sector");
else if ((NO_SOLVER_SECTORS as readonly string[]).includes(sector)) report("captchaSolver", path, `a captcha solver is never allowed on a ${sector} site`);
if (sensitive) report("captchaSolver", path, "a captcha solver is never allowed on an errand with a declare or identity-proofing step or a secret input");
});
// A hand-off card is shared on purpose: it may name built-ins and public
// inputs, and nothing a person would not post on a fridge.
for (const [id, card] of Object.entries(handoffs)) {