# Handoff — 2026-05-08 (post NL-rules PR session)

## What landed (or is landing)

Two PRs against this repo, opened today:

- [PR #44](https://github.com/Agent-Threat-Rule/agent-threat-rules/pull/44) — engine fix (code-block + table-cell suppression for array-format rules). Rebased on main after the parallel TC-auth fix in 5cb6a75 landed.
- [PR #45](https://github.com/Agent-Threat-Rule/agent-threat-rules/pull/45) — 10 NL-style attack-pattern rules (00421 through 00430).

After both merge, the publish-on-rules-merge workflow auto-publishes `agent-threat-rules` to npm as v2.0.18 (or higher; the bump-patch script picks the next version).

Two docs and one outreach package in the panguard-ai repo:

- `chore/website-pricing-v4-stats-day55` branch — bumped 314 → 324, removed fake `/press` content, fixed broken links, rewrote `/legal/security` honestly, added v2.0.18 NL coverage to ATR Detection Pipeline copy, and added blog post `/blog/we-found-our-scanner-broken-and-fixed-it`.
- `~/panguard-outreach/ph-launch-2026-q2/PRODUCT-HUNT-LAUNCH.md` — full PH launch package with submission fields, demo script, founder comment, distribution checklist, risk register, and a localized zh-TW Threads post.

---

## Things only you can do

These require credentials or repo-admin actions I cannot perform.

### 1. Set TC ingestion config in this repo

Without these, the `daily-scan` workflow will keep skipping the `Push to Threat Cloud` step and the flywheel stays frozen.

Variable (Settings → Variables → Actions → New repository variable):
```
Name:  TC_URL
Value: https://tc.panguard.ai
```

Secret (Settings → Secrets → Actions → New repository secret):
```
Name:  TC_API_KEY
Value: <your TC admin API key from tc.panguard.ai/admin>
```

After saving, manually trigger one daily-scan run via Actions → "Daily Ecosystem Scan" → "Run workflow" to verify the `Push to Threat Cloud` step is no longer skipped.

### 2. Republish panguard CLI to v1.5.5

The npm-published version of `panguard` is still 1.3.0 (months stale). Local monorepo is at 1.5.4 with all the fixes that depend on `agent-threat-rules@latest`. Bump and tag:

```
cd /Users/user/Downloads/panguard-ai/packages/panguard
# bump version to 1.5.5 in package.json
pnpm version 1.5.5 --no-git-tag-version
cd ../..
git add packages/panguard/package.json
git commit -m "chore(cli): bump panguard 1.5.4 → 1.5.5"
git push
git tag v1.5.5
git push origin v1.5.5
```

The `publish.yml` and `release.yml` workflows auto-fire on `v*` tags. They will build and publish to npm using the `NPM_TOKEN` secret already configured in panguard-ai repo.

### 3. (Optional) Manually merge PR #44 / #45 if I haven't

If for any reason this session ends before both are merged, the merge order matters:

```
gh pr merge 44 --squash --delete-branch  # engine fix (no dependencies)
# wait for main to update
gh pr checks 45                          # confirm CI re-ran
gh pr merge 45 --squash --delete-branch  # rules
```

PR #45 will need rebase on main first if its CI was failing because of the engine dependency.

---

## What was learned (non-obvious things worth keeping)

Two engine bugs were silently affecting every existing rule and only surfaced because I tried to validate new rules against a real-world corpus larger than the curated 431-sample CI gate:

- The non-greedy regex for code-block detection (`/```[\s\S]*?```/g`) silently mis-pairs fence markers when their count is odd or when prose contains stray triple-backticks. The existing 431-sample benign corpus does not include enough markdown-heavy skills to surface this, but the 3,115-sample skills.sh corpus does. Replaced with a line-state machine.

- Suppression logic was implemented in the named-map condition path only. Array-format rules — which is the format every rule from 2026 onward uses — silently bypassed the per-rule `suppress_in_code_blocks` flag. Added the same check to `evaluateArrayCondition`.

- Eval-suite skills (axiomhq/writing-evals, etc.) list adversarial test-case strings as quoted attack payloads in markdown table rows. Without table-cell quoted-string suppression, every prompt-injection rule fires on these. Added that as a third suppression class.

- The CI gate corpus (`data/skill-benchmark/benign/`, 431 samples) does not include pentest skills, eval suites, or skill-self-resource references. Future rule authors will hit FPs on these classes if they ship rules without testing against the wider 3,115-sample skills.sh corpus. Worth adding representatives of these classes to the CI corpus eventually.

---

## State of TC flywheel post-session

Before today:
- `daily-scan.yml` ran every day at 03:30 UTC. `Push to Threat Cloud` step skipped because `vars.TC_URL` was unset.
- `tc-pr-back.yml` ran 5x/day. Logged "TC rules: 311 | New: 0" because TC was frozen.
- `publish-on-rules-merge.yml` last successful publish 2026-04-21.
- TC database frozen at 311 rules for 14+ days.
- Last TC-derived merged PR was #41 (2026-04-21).

What's been fixed in main today (by both me and the parallel work in 5cb6a75):
- `scripts/push-to-threat-cloud.ts` now sends `Authorization: Bearer ${TC_API_KEY}` to all four `fetch()` paths (TC server expects Bearer, not x-api-key).
- Engine code-block / table-cell suppression for array-format rules (PR #44, pending merge as of writing).

What still requires your action:
- `vars.TC_URL` in this repo settings.
- `secrets.TC_API_KEY` in this repo settings.
- Once those are set, the daily-scan flywheel resumes ingestion. Within 24-48h there should be new `atr_proposals` showing up in TC. Within a week, new community-derived rule PRs.

---

## Quick reference

| Item | Where |
|---|---|
| PR #44 (engine) | https://github.com/Agent-Threat-Rule/agent-threat-rules/pull/44 |
| PR #45 (rules) | https://github.com/Agent-Threat-Rule/agent-threat-rules/pull/45 |
| Website branch | https://github.com/panguard-ai/panguard-ai/tree/chore/website-pricing-v4-stats-day55 |
| Blog post slug | `we-found-our-scanner-broken-and-fixed-it` |
| PH launch doc | `~/panguard-outreach/ph-launch-2026-q2/PRODUCT-HUNT-LAUNCH.md` |
| Status report | `~/Downloads/panguard-enterprise/STATUS-2026-05-06.md` |
