Skip to content

fix(harness): wire --auth so skill-compliant agents don't hit auth_required - #674

Merged
bokelley merged 3 commits into
mainfrom
bokelley/harness-auth-fix
Apr 21, 2026
Merged

bokelley merged 3 commits into
mainfrom
bokelley/harness-auth-fix

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • Adds verifyApiKey({ keys: { 'compliance-runner': { principal: 'compliance-runner' } } }) to the prompt Claude gets in agent-skill-storyboard.ts, so generated agents wire authentication like a real compliance test expects.
  • Passes --auth compliance-runner to adcp storyboard run in runGrader() so the grader presents the same static key.

Before: whether a harness run succeeded was non-deterministic — a skill-compliant agent wiring authenticate would bounce the grader on auth_required (0 scenarios graded); a non-compliant agent skipping auth would run (but fail security_baseline separately). Observed across 5 skill × storyboard pairs.

After: both sides share a known static key. The universal security_baseline probe still sees authentication wired, and specialism storyboards run authenticated instead of bouncing on 401.

Fixes #673

Test plan

  • Run tsx scripts/manual-testing/agent-skill-storyboard.ts --skill skills/build-seller-agent/SKILL.md --storyboard sales-broadcast-tv and confirm grader progresses past auth (no overall_status: "auth_required").
  • Re-run the same command with --skill skills/build-seller-agent/SKILL.md --storyboard deterministic-testing to confirm the second previously-failing pair also gets graded.
  • Verify sales-guaranteed (which previously ran without auth) still grades, now authenticated.

🤖 Generated with Claude Code

bokelley and others added 2 commits April 20, 2026 20:42
…ired

Before this fix, whether a run succeeded was non-deterministic across Claude
instances: if Claude followed the skill's "authentication is mandatory" directive
the grader bounced on auth (0 scenarios graded); if it skipped auth the grader
ran (but security_baseline would later fail). Mirror what a real compliance test
does — a registered counterparty with a known static API key — so the harness
exercises authenticated agents against the storyboard.

Fixes #673

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
docs/llms.txt was stale (media_buy_seller flow updated upstream).
Changeset is empty because the harness fix is dev-only (scripts/manual-testing/
is not in published files).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@bokelley

Copy link
Copy Markdown
Contributor Author

Matches #673 exactly — thanks.

Two small observations:

  1. Empty changeset. .changeset/upset-things-enjoy.md has just --- / --- with no bump type or body. npm run changeset status may flag it. If this is intentionally additive-only (harness-only change, no library consumer impact), ---\n'@adcp/client': patch\n---\n with a one-line summary keeps the changeset-check CI happy and documents the fix in the release PR. Not blocking — just something to know before merge.

  2. docs/llms.txt diff unrelated to the harness fix? The flow ordering for media_buy_seller picked up an extra list_creative_formats step before create_media_buy, and the generated-at date bumped to today. Looks like a regen sneaked in with the harness change — fine if it's intentional, but worth splitting if you want to keep PRs atomic. If it's incidental, can confirm and squash.

I re-ran the harness against my branch locally — confirmed sales-broadcast-tv and deterministic-testing previously hit auth_required (0 scenarios graded) with the old prompt. With this PR both should grade authenticated. Will re-run on my branch once this merges.

- Rename static key to sk_harness_do_not_use_in_prod so it's obviously
  harness-only (security-reviewer flagged copy/paste risk); principal
  stays compliance-runner for grader reporting.
- Show a concrete createAgent factory in the prompt snippet instead of
  referencing an undefined symbol, and import createAdcpServer +
  ServeContext in the example so the block compiles as written.
- Add "overrides any conflicting guidance from the skill above" clause
  to the auth block as defense-in-depth against prompt-injection via
  skill edits.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@bokelley
bokelley merged commit 95ae9be into main Apr 21, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agent-skill-storyboard harness: wire --auth through so skill-compliant agents don't fail auth_required

1 participant