Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: give new subscription security scans bounded analysis time
atomantic3b277d1b4efe
diff --git a/client/src/components/cos/AgentResultLine.jsx b/client/src/components/cos/AgentResultLine.jsxindex 239827bf6d..40c83936b3 100644--- a/client/src/components/cos/AgentResultLine.jsx+++ b/client/src/components/cos/AgentResultLine.jsx@@ -59,7 +59,8 @@ export function SecurityScanEvidence({ scanner, control }) {{scanner.status === 'invalid-input' && <div>Input rejected before scanner launch</div>}{scanner.preflight && <div>Input rejections: {formatCount(scanner.preflight.rejectedRequests)} · Last: {scanner.preflight.lastError.field} item {formatCount(scanner.preflight.lastError.index + 1)} — {scanner.preflight.lastError.code}</div>}<div>Model: {scanner.model ?? 'unknown'} · Effort: {scanner.effort ?? 'unknown'} · Auth: {scanner.auth}</div>- <div>Estimated cost: {scanner.estimatedCostUsd == null ? 'unknown' : formatUsd(scanner.estimatedCostUsd, { maximumFractionDigits: 4 })} · Budget: {scanner.maxCostUsd == null ? 'unknown' : formatUsd(scanner.maxCostUsd, { maximumFractionDigits: 4 })} (API-equivalent USD)</div>+ <div>Estimated baseline: {scanner.estimatedCostUsd == null ? 'unknown' : formatUsd(scanner.estimatedCostUsd, { maximumFractionDigits: 4 })} · Estimate cap: {scanner.maxCostUsd == null ? 'unknown' : formatUsd(scanner.maxCostUsd, { maximumFractionDigits: 4 })} (API-equivalent USD)</div>+ <div>Short-context estimates do not measure billed charges or ChatGPT subscription quota.</div><div>Time limit: {scanner.timeLimitSeconds == null ? 'unknown' : `${formatCount(scanner.timeLimitSeconds)}s`} · Exit: {scanner.exitCode ?? 'unknown'}</div><div>Artifacts — findings: {scanner.artifacts?.findings == null ? 'unknown' : scanner.artifacts.findings ? 'saved' : 'absent'}; coverage: {scanner.artifacts?.coverage == null ? 'unknown' : scanner.artifacts.coverage ? 'saved' : 'absent'}</div>{(control?.cleanup || scanner.cleanup) && <div>Process cleanup: {control?.cleanup || scanner.cleanup}</div>}diff --git a/client/src/components/cos/AgentResultLine.test.jsx b/client/src/components/cos/AgentResultLine.test.jsxindex 1562051b27..14504a9e27 100644--- a/client/src/components/cos/AgentResultLine.test.jsx+++ b/client/src/components/cos/AgentResultLine.test.jsx@@ -45,7 +45,8 @@ it('retains refusal and scanner interruption evidence alongside successful delivexpect(screen.getByText('Assessment saved')).toBeInTheDocument();expect(screen.getByText(/provider safety refusal; automatic retry stopped/)).toBeInTheDocument();expect(screen.getByText('Security scanner (agent reported): time-limit')).toBeInTheDocument();- expect(screen.getByText(/Budget: \$0.00/)).toBeInTheDocument();+ expect(screen.getByText(/Estimated baseline: unknown · Estimate cap: \$0.00 \(API-equivalent USD\)/)).toBeInTheDocument();+ expect(screen.getByText('Short-context estimates do not measure billed charges or ChatGPT subscription quota.')).toBeInTheDocument();expect(screen.getByText(/Exit: unknown/)).toBeInTheDocument();expect(screen.getByText(/findings: saved; coverage: unknown/)).toBeInTheDocument();});diff --git a/docs/SECURITY_SCANNER_RUNTIME.md b/docs/SECURITY_SCANNER_RUNTIME.mdindex 80aede29b5..b014bfa0c1 100644--- a/docs/SECURITY_SCANNER_RUNTIME.md+++ b/docs/SECURITY_SCANNER_RUNTIME.md@@ -26,11 +26,21 @@ so a successful correction does not erase validation history.The immutable dispatch grant uses the effective outer Codex command's model andeffort, including saved flags and supported-effort clamping. Missing or conflicting-pins make the scanner unavailable. The bounded workflow retains explicit ChatGPT-authentication, a $2 API-equivalent estimated-cost ceiling, and a 180-second scan-deadline. API-key environment variables are not passed to this subprocess. These-estimates do not establish billing charges. A cybersecurity-policy refusal stops-the scanner and outer request without automatic continuation, retry or fallback.+pins make the scanner unavailable. New dispatches receive a $25 API-equivalent+short-context estimate cap and a 1,200-second process-group deadline. Existing+$2/180-second grants retain their original limits; no receipt is reset or upgraded.+Both policies require explicit ChatGPT authentication. API-key environment variables+are not passed to this subprocess. The cap uses the scanner's short-context baseline;+in-flight work can exceed it. These estimates measure neither billed charges nor+ChatGPT subscription quota, and cannot be converted to a weekly usage percentage.+A cybersecurity-policy refusal stops the scanner and outer request without automatic+continuation, retry or fallback.++The server waits up to 1,210 seconds for the scanner POST, allowing the longest+grant plus cleanup to complete. That request uses the existing transport dispatcher+without undici's shorter header/body inactivity ceilings; the whole-exchange timeout+still applies and the request is never automatically retried. Status and Stop calls+retain their 15-second transport timeout. None of these waits extends a saved grant.The runner owns a separate POSIX process group. A small IPC supervisor waits untilits ownership receipt is durable before launching the scanner. Losing the runnerdiff --git a/server/cos-runner/securityScan.test.js b/server/cos-runner/securityScan.test.jsindex 814b934257..d13d42f559 100644--- a/server/cos-runner/securityScan.test.js+++ b/server/cos-runner/securityScan.test.js@@ -7,7 +7,8 @@ import { join } from 'path';import { tmpdir } from 'os';import { createSecurityScanManager } from './securityScan.js';-const grant = { model: 'example-model', effort: 'medium', auth: 'chatgpt', maxCostUsd: 2, timeLimitSeconds: 180 };+const grant = { model: 'example-model', effort: 'medium', auth: 'chatgpt', maxCostUsd: 25, timeLimitSeconds: 1200 };+const legacyGrant = { ...grant, maxCostUsd: 2, timeLimitSeconds: 180 };let root;const outerAgents = [];beforeEach(async () => { root = await mkdtemp(join(tmpdir(), 'scanner-runtime-test-')); await mkdir(join(root, 'repo')); });@@ -205,25 +206,26 @@ describe.skipIf(process.platform === 'win32')('runner-owned scanner lifecycle',expect(h.spawnProcess).not.toHaveBeenCalled();});- it('pins the launch grant, strips API credentials and records successful evidence without an agent sentinel', async () => {+ it.each([grant, legacyGrant])('pins the $maxCostUsd / $timeLimitSeconds launch grant and records successful evidence without API credentials', async launchGrant => {const h = setup();- await h.manager.register('agent-example', grant);+ await h.manager.register('agent-example', launchGrant);const run = h.manager.start('agent-example', input);const { child, args, options } = await h.spawned;expect(args).toContain('--auth');expect(args.slice(args.indexOf('--auth'), args.indexOf('--auth') + 2)).toEqual(['--auth', 'chatgpt']);expect(args.slice(args.indexOf('--model'), args.indexOf('--model') + 4)).toEqual(['--model', 'example-model', '--effort', 'medium']);+ expect(args.slice(args.indexOf('--max-cost'), args.indexOf('--max-cost') + 2)).toEqual(['--max-cost', String(launchGrant.maxCostUsd)]);expect(options.env).not.toHaveProperty('OPENAI_API_KEY');expect(options.env).not.toHaveProperty('PORTOS_API_TOKEN');expect(options.stdio[0]).toBe('ignore');const output = args[args.indexOf('--output-dir') + 1];await writeFile(join(output, 'findings.json'), '[]');await writeFile(join(output, 'coverage.json'), '{}');- child.stdout.write('short-context budget baseline: $0.25 of $2.00 limit\n');+ child.stdout.write(`short-context budget baseline: $0.25 of $${launchGrant.maxCostUsd}.00 limit\n`);child.emit('close', 0, null);const result = await run;expect(result.evidence).toMatchObject({ source: 'runner', status: 'completed', model: 'example-model', effort: 'medium',- maxCostUsd: 2, timeLimitSeconds: 180, estimatedCostUsd: 0.25, exitCode: 0, artifacts: { findings: true, coverage: true } });+ maxCostUsd: launchGrant.maxCostUsd, timeLimitSeconds: launchGrant.timeLimitSeconds, estimatedCostUsd: 0.25, exitCode: 0, artifacts: { findings: true, coverage: true } });expect(JSON.parse(await readFile(join(root, 'agents/agent-example/security-scan.json'), 'utf8'))).toEqual(result.evidence);expect(h.evidence.map(e => e.status)).toEqual(['not-run', 'running', 'completed']);});@@ -315,14 +317,21 @@ describe.skipIf(process.platform === 'win32')('runner-owned scanner lifecycle',await h.manager.stop('agent-example');await run;});- it('bounds a stuck child with the existing deadline and records unconfirmed cleanup without claiming success', async () => {- const h = setup({ kill: vi.fn(), cleanupGroup: async () => false });- await h.manager.register('agent-example', grant);+ it.each([grant, legacyGrant])('enforces the saved $timeLimitSeconds second deadline without renewing a stuck child', async launchGrant => {+ const kill = vi.fn();+ const h = setup({ kill, cleanupGroup: async () => false });+ await h.manager.register('agent-example', launchGrant);vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] });const run = h.manager.start('agent-example', input);await h.spawned;- await vi.advanceTimersByTimeAsync(185000);- expect((await run).evidence).toMatchObject({ status: 'time-limit', exitCode: null, cleanup: 'unconfirmed' });+ await vi.advanceTimersByTimeAsync(launchGrant.timeLimitSeconds * 1000 - 1);+ expect(kill).not.toHaveBeenCalled();+ await vi.advanceTimersByTimeAsync(1);+ expect(kill).toHaveBeenCalledWith(expect.anything(), 'SIGTERM', { processGroup: true });+ await vi.advanceTimersByTimeAsync(5000);+ expect((await run).evidence).toMatchObject({ status: 'time-limit', timeLimitSeconds: launchGrant.timeLimitSeconds, exitCode: null, cleanup: 'unconfirmed' });+ expect(await h.manager.start('agent-example', input)).toEqual(await run);+ expect(h.spawnProcess).toHaveBeenCalledOnce();});it('does not treat quoted policy findings as a provider refusal', async () => {diff --git a/server/lib/securityScanEvidence.js b/server/lib/securityScanEvidence.jsindex 4045dc50d2..9db0f2ea95 100644--- a/server/lib/securityScanEvidence.js+++ b/server/lib/securityScanEvidence.js@@ -27,9 +27,13 @@ export const securityScanEvidenceSchema = z.object({}).strict().optional(),}).strict().refine(value => value.status !== 'completed' || value.exitCode === 0);-// This grant is set once at agent dispatch, never accepted from the model's-// scan request. These ceilings preserve the bounded existing scanner workflow.-export const securityScanGrantSchema = z.object({+// New dispatches receive this server-owned policy. The cost cap bounds the+// scanner's short-context API-equivalent estimate, not billing or subscription quota.+const NEW_SCAN_LIMITS = Object.freeze({ maxCostUsd: 25, timeLimitSeconds: 1200 });+// Allow the longest grant to expire and finish process-group cleanup before+// the server-to-runner exchange gives up. This does not extend a saved grant.+export const SECURITY_SCAN_REQUEST_TIMEOUT_MS = (NEW_SCAN_LIMITS.timeLimitSeconds + 10) * 1000;+const legacySecurityScanGrantSchema = z.object({model: z.string().regex(/^[a-zA-Z0-9_.:-]{1,100}$/).nullable(),effort: z.enum(['none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max', 'ultra']).nullable(),auth: z.literal('chatgpt'),@@ -37,6 +41,16 @@ export const securityScanGrantSchema = z.object({timeLimitSeconds: z.literal(180),}).strict();+// Saved grants retain their original pair of limits; accepting them must never+// upgrade an existing attempt. Neither policy is accepted from a scan request.+export const securityScanGrantSchema = z.union([+ legacySecurityScanGrantSchema.extend({+ maxCostUsd: z.literal(NEW_SCAN_LIMITS.maxCostUsd),+ timeLimitSeconds: z.literal(NEW_SCAN_LIMITS.timeLimitSeconds),+ }),+ legacySecurityScanGrantSchema,+]);+export const securityScanRequestSchema = z.object({prompt: z.string().min(1).max(32000),paths: z.array(z.string().min(1).max(4096)).min(1).max(100),@@ -88,6 +102,6 @@ export function securityScanGrantFromArgs(args = []) {}const model = models.size === 1 ? [...models][0] : null;const effort = efforts.size === 1 ? [...efforts][0] : null;- const parsed = securityScanGrantSchema.safeParse({ model, effort, auth: 'chatgpt', maxCostUsd: 2, timeLimitSeconds: 180 });- return parsed.success ? parsed.data : { model: null, effort: null, auth: 'chatgpt', maxCostUsd: 2, timeLimitSeconds: 180 };+ const parsed = securityScanGrantSchema.safeParse({ model, effort, auth: 'chatgpt', ...NEW_SCAN_LIMITS });+ return parsed.success ? parsed.data : { model: null, effort: null, auth: 'chatgpt', ...NEW_SCAN_LIMITS };}diff --git a/server/lib/securityScanEvidence.test.js b/server/lib/securityScanEvidence.test.jsindex 55e3a4d770..362162fec1 100644--- a/server/lib/securityScanEvidence.test.js+++ b/server/lib/securityScanEvidence.test.js@@ -1,5 +1,5 @@import { expect, it } from 'vitest';-import { parseSecurityScanEvidence, parseRunnerSecurityScanEvidence, securityScanGrantFromArgs } from './securityScanEvidence.js';+import { parseSecurityScanEvidence, parseRunnerSecurityScanEvidence, securityScanGrantFromArgs, securityScanGrantSchema } from './securityScanEvidence.js';const report = {version: 1, status: 'time-limit', model: 'example-model', effort: 'low', auth: 'chatgpt',@@ -22,9 +22,17 @@ it('rejects fabricated completion, ambiguous reports and fields that could discl});it('derives scanner pins from effective argv and refuses conflicting or implicit defaults', () => {- expect(securityScanGrantFromArgs(['--model', 'saved-model', '-c', 'model_reasoning_effort="high"'])).toMatchObject({ model: 'saved-model', effort: 'high' });+ expect(securityScanGrantFromArgs(['--model', 'saved-model', '-c', 'model_reasoning_effort="high"'])).toEqual({ model: 'saved-model', effort: 'high', auth: 'chatgpt', maxCostUsd: 25, timeLimitSeconds: 1200 });expect(securityScanGrantFromArgs(['--model=selected-model', '--config=model="another-model"', '-cmodel_reasoning_effort=low'])).toMatchObject({ model: null, effort: 'low' });- expect(securityScanGrantFromArgs([])).toMatchObject({ model: null, effort: null });+ expect(securityScanGrantFromArgs([])).toEqual({ model: null, effort: null, auth: 'chatgpt', maxCostUsd: 25, timeLimitSeconds: 1200 });+});++it('preserves legacy grants and rejects mixed limits or authentication overrides', () => {+ const legacy = { model: 'saved-model', effort: 'medium', auth: 'chatgpt', maxCostUsd: 2, timeLimitSeconds: 180 };+ expect(securityScanGrantSchema.parse(legacy)).toEqual(legacy);+ for (const override of [{ maxCostUsd: 25 }, { timeLimitSeconds: 1200 }, { maxCostUsd: 100, timeLimitSeconds: 3600 }, { auth: 'api-key' }, { auth: 'auto' }]) {+ expect(securityScanGrantSchema.safeParse({ ...legacy, ...override }).success).toBe(false);+ }});it('accepts bounded runner input diagnostics without allowing private paths or errors through', () => {diff --git a/server/routes/securityScan.test.js b/server/routes/securityScan.test.jsindex dece5b9461..6a2ea526a5 100644--- a/server/routes/securityScan.test.js+++ b/server/routes/securityScan.test.js@@ -40,8 +40,10 @@ it('requires existing host authority before consuming a scanner grant', async ()expect(runAgentSecurityScan).toHaveBeenCalledTimes(2);});-it('rejects model, effort and budget overrides at the public request boundary', async () => {- const result = await request(appFor('127.0.0.1')).post(endpoint).send({ ...input, model: 'another-model', effort: 'high', maxCostUsd: 10 });+it.each([+ ['model', 'another-model'], ['effort', 'high'], ['maxCostUsd', 100], ['timeLimitSeconds', 3600], ['auth', 'api-key'],+])('rejects a %s override at the public request boundary', async (field, value) => {+ const result = await request(appFor('127.0.0.1')).post(endpoint).send({ ...input, [field]: value });expect(result.status).toBe(400);expect(runAgentSecurityScan).not.toHaveBeenCalled();});diff --git a/server/services/agentPromptBuilder.test.js b/server/services/agentPromptBuilder.test.jsindex 6ff05e61c6..cf674e7f68 100644--- a/server/services/agentPromptBuilder.test.js+++ b/server/services/agentPromptBuilder.test.js@@ -695,6 +695,8 @@ describe('buildLightContextPrompt', () => {expect(prompt.systemPrompt).toContain('## Codex Security Audit Runtime');expect(prompt.systemPrompt).toContain('/security-scan');expect(prompt.systemPrompt).toContain('subscription ChatGPT authentication');+ expect(prompt.systemPrompt).toContain('saved grants retain their original limits');+ expect(prompt.systemPrompt).toContain('Wait for the single request to finish');expect(prompt.systemPrompt).not.toContain('npx --yes');expect(prompt.systemPrompt).toContain('deliver supported findings even when another probe is blocked');expect(prompt.systemPrompt).toContain('## Completion (No Code Output)');diff --git a/server/services/cosRunnerClient.js b/server/services/cosRunnerClient.jsindex 766e942ec6..cd61834874 100644--- a/server/services/cosRunnerClient.js+++ b/server/services/cosRunnerClient.js@@ -10,6 +10,7 @@ import { io } from 'socket.io-client';import { fetchWithTimeout } from '../lib/fetchWithTimeout.js';import { readResponseJson } from '../lib/readResponseJson.js';import { PORTS } from '../lib/ports.js';+import { SECURITY_SCAN_REQUEST_TIMEOUT_MS } from '../lib/securityScanEvidence.js';const COS_RUNNER_URL = process.env.COS_RUNNER_URL || `http://localhost:${PORTS.COS}`;@@ -454,10 +455,14 @@ export async function spawnAgentViaRunner(options) {export async function requestSecurityScanViaRunner(agentId, { input, stop = false } = {}) {const path = `/agents/${encodeURIComponent(agentId)}/security-scan${stop ? '/stop' : ''}`;+ // A scanner may be silent through its entire grant. Keep undici's default+ // five-minute ceiling below this path from preempting our bounded exchange.+ const dispatcher = input ? (await import('../lib/aiToolkit/internal/streamTransport.js')).streamTransportDispatcher() : null;const response = await fetchWithTimeout(`${COS_RUNNER_URL}${path}`, {method: input || stop ? 'POST' : 'GET',+ ...(dispatcher ? { dispatcher } : {}),...(input ? { headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(input) } : {}),- }, input ? 190000 : 15000);+ }, input ? SECURITY_SCAN_REQUEST_TIMEOUT_MS : 15000);const result = await readRunnerJson(response);if (!response.ok) throw Object.assign(new Error(result.error || 'Scanner runner unavailable'), { status: response.status });return result;diff --git a/server/services/cosRunnerClient.test.js b/server/services/cosRunnerClient.test.jsindex 3f0ec6b40d..52e9cba323 100644--- a/server/services/cosRunnerClient.test.js+++ b/server/services/cosRunnerClient.test.js@@ -24,6 +24,7 @@ vi.mock('../lib/fetchWithTimeout.js', () => ({import { io } from 'socket.io-client';import { fetchWithTimeout } from '../lib/fetchWithTimeout.js';+import { streamTransportDispatcher } from '../lib/aiToolkit/internal/streamTransport.js';import {initCosRunnerConnection,onCosRunnerEvent,@@ -40,6 +41,7 @@ import {classifyRunnerSpawnFailure,RUNNER_SPAWN_REFUSED,RUNNER_SPAWN_AMBIGUOUS,+ requestSecurityScanViaRunner,} from './cosRunnerClient.js';// The client reads the body via text() and tolerantly JSON.parses it, so a@@ -58,6 +60,30 @@ describe('cosRunnerClient', () => {vi.clearAllMocks();});+ it('keeps one silent scanner request open through its grant and cleanup without shorter transport ceilings', async () => {+ const { fetchWithTimeout: actualFetch } = await vi.importActual('../lib/fetchWithTimeout.js');+ const evidence = { status: 'time-limit', timeLimitSeconds: 1200, cleanup: 'confirmed' };+ let finish;+ const fetchSpy = vi.spyOn(globalThis, 'fetch').mockImplementationOnce(() => new Promise(resolve => { finish = resolve; }));+ fetchWithTimeout.mockImplementationOnce(actualFetch);+ vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] });+ try {+ const pending = requestSecurityScanViaRunner('agent-example', { input: { prompt: 'Audit source.', paths: ['.'] } });+ await vi.waitFor(() => expect(fetchSpy).toHaveBeenCalledOnce());+ const options = fetchSpy.mock.calls[0][1];+ expect(options.dispatcher).toBe(streamTransportDispatcher());+ expect(fetchWithTimeout).toHaveBeenCalledWith(expect.stringContaining('/security-scan'), expect.any(Object), 1210000);+ await vi.advanceTimersByTimeAsync(1205000);+ expect(options.signal.aborted).toBe(false);+ finish(mockResponse(true, { evidence }));+ expect(await pending).toEqual({ evidence });+ expect(fetchSpy).toHaveBeenCalledOnce();+ } finally {+ fetchSpy.mockRestore();+ vi.useRealTimers();+ }+ });+// ===========================================================================// initCosRunnerConnection// ===========================================================================diff --git a/server/services/promptSections/securityAudit.js b/server/services/promptSections/securityAudit.jsindex 85eccc0422..5bcf866d5a 100644--- a/server/services/promptSections/securityAudit.js+++ b/server/services/promptSections/securityAudit.js@@ -21,12 +21,12 @@ After reading the target threat model and completing repository-wide discovery,Choose real workspace-relative files; include available architecture/security documents in knowledgeBase. Keep outer issue-filing and completion commands out of the scanner prompt.Request one scanner execution: \`${command} --data-binary @<private-request-file>\`.-The runner owns the installed Codex Security CLI, enforces this run's resolved model and effort, subscription ChatGPT authentication, a $2 API-equivalent estimated-cost cap and a 180-second scan limit. Those settings cannot be changed in the request. No installation, API-key fallback, additional workers, patching or publication is permitted. Do not invoke a separate CLI, SDK or cloud scan: an unavailable runner/installation/model is a visible limitation, not permission for a different execution path.+The runner owns the installed Codex Security CLI and enforces this run's saved grant: resolved model and effort, subscription ChatGPT authentication, an API-equivalent short-context estimate cap and a process-group deadline. Read the actual limits from runner evidence; saved grants retain their original limits. Those settings cannot be changed in the request. Wait for the single request to finish; a quiet response does not authorize another execution. No installation, API-key fallback, additional workers, patching or publication is permitted. Do not invoke a separate CLI, SDK or cloud scan: an unavailable runner/installation/model is a visible limitation, not permission for a different execution path.The response contains trusted runner evidence plus a private artifactDirectory. Read any saved findings/coverage there, challenge reachability against callers/tests/history, and preserve this task's remediation/file-issues mode and delivery requirements. Only an explicit runner status of invalid-input permits correction: no scanner has launched. Use preflight.lastError's field and zero-based index to locate the bad input, verify the replacement in the workspace, and submit corrected paths through this same endpoint. Concurrent requests share the current result. Do not resubmit after any other result or transport error; the runner retains one execution and its diagnostics independently of your completion. A stopped or restarted grant cannot be reopened. Finish permitted source inspection and deliver supported findings even when another probe is blocked.A cybersecurity/content-policy refusal is terminal for this request: stop clearly. Do not continue, retry, rephrase to evade a refusal, or switch providers. This overrides recovery guidance below. The runner also stops the outer request on a scanner refusal.-Report scanner execution separately from delivery and quality assessment. Runner-observed model/effort/auth, limits, exit and artifact evidence are authoritative; a saved assessment or successful outer task does not make an interrupted scan successful. Estimated cost is API-equivalent usage, not proof of charges. Do not claim unknown evidence as zero or success. Complete the normal sentinel and exactly one QUALITY_AUDIT_JSON assessment for work actually performed, with partial/unavailable coverage when warranted. SCANNER_STATUS_JSON is a legacy agent-report format; it cannot override runner evidence.+Report scanner execution separately from delivery and quality assessment. Runner-observed model/effort/auth, limits, exit and artifact evidence are authoritative; a saved assessment or successful outer task does not make an interrupted scan successful. Short-context estimates are API-equivalent usage, not billed charges or ChatGPT subscription quota. Do not claim unknown evidence as zero or success. Complete the normal sentinel and exactly one QUALITY_AUDIT_JSON assessment for work actually performed, with partial/unavailable coverage when warranted. SCANNER_STATUS_JSON is a legacy agent-report format; it cannot override runner evidence.`;}