/** * CodeRifts agent-host policy text. * * Vendored from coderifts-app `src/agent-host-rule.js` `getCanonicalRuleText()`. * Drift-gated by `test/policy-vendored-sync.test.js` (byte-equal to the app * canonical text; missing app checkout fails loud — never skip). * * This proves the TEXT is present when injected/detected, not that the model * read or obeyed it. */ /** Phrase present in ALL seven generated host formats (AGENTS.md, CLAUDE.md, cursor rules, Copilot instructions, LangGraph policy, OpenAI agent instructions, skills/api-governance/SKILL.md). */ export declare const POLICY_MARKER = "A receipt authorizes ONE operation: a merge receipt does not authorize a deploy."; /** Canonical policy body (paragraphs joined by blank lines). */ export declare const CODERIFTS_POLICY: string; /** Once-per-process warning when the host supplied a prompt that lacks the marker. */ export declare const POLICY_ABSENT_WARN = "CodeRifts policy text not detected in the system prompt. The agent will still see the tools, but measured evidence shows operation-scope misuse is markedly more likely without it. See https://github.com/coderifts/agent-guard#policy-delivery."; export type PolicyPresence = 'detected' | 'absent' | 'unknown'; export type WithPolicyOptions = { /** * Default true. `false` returns a non-mutated copy and does not append. * Opt-out for hosts that call `withPolicy` from a shared wrapper. */ injectPolicy?: boolean; }; /** Minimal chat message shape (OpenAI/Anthropic-compatible). Extra fields are preserved. */ export type PolicyMessage = { role: string; content?: unknown; [key: string]: unknown; }; /** * Observation-only classification of host-supplied instruction text. * `null`/`undefined` -> `unknown` (host did not tell us). Anything else is * `detected` or `absent` based on POLICY_MARKER. */ export declare function policyPresenceOf(text: string | null | undefined): PolicyPresence; /** Alias used by hosts that call the check at startup without the guard. */ export declare function detectPolicyPresence(text: string | null | undefined): PolicyPresence; /** * Append the canonical policy text if the marker is not already present. * Never mutates the caller's string/array/objects — always returns a new value * for arrays; strings are new only when appending. */ export declare function withPolicy(input: string, opts?: WithPolicyOptions): string; export declare function withPolicy(input: readonly T[], opts?: WithPolicyOptions): T[]; /** Once-per-process warn. Subsequent absent detections stay silent. */ export declare function warnPolicyAbsentOnce(): void; /** * Classify + maybe warn. `unknown` never warns. `detected` is silent. * `absent` warns once per process. */ export declare function observePolicyPresence(text: string | null | undefined): PolicyPresence; /** Test-only: allow the once-warn to fire again. */ export declare function resetPolicyWarnForTests(): void; //# sourceMappingURL=policy.d.ts.map