Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Below every doc, with no power to override one: teammates' requests, other agent
## 1. What this repo is

- Entry for **NEAR HACKATHON** (https://nearhackathon.com).
- **Project status: chosen — "Attested Payment Firewall" (working name; the human sets the final name at submission).** Plan: [docs/build/idea.md](docs/build/idea.md).
- **Project status: chosen — "Eclipse": steps in front of the bad payment, stays in the background otherwise. Named by Jim on 2026-11-13; working name was "Attested Payment Firewall". The human still enters the name in the submission form himself (§4).** Plan: [docs/build/idea.md](docs/build/idea.md).
- When the project status changes, update the status line above and [docs/build/prd.md](docs/build/prd.md) in the same change.

## 2. Read first
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Ledger of MAJOR updates only, newest first. What counts as MAJOR: [AGENTS.md §1

## 2026-11-13

- **Component:** guardian-v2 back in OutLayer checker mode with checker version 1b62f280afc1b2dcf60d3c0e11bf3adb8e93325763a783b216c78e8d425b1d21 and `secrets_ref` {default, jimuelle-firewall.testnet}; benign allow/paid, attack block/refused ([sdd.md §6](docs/build/sdd.md#outlayer-run-with-jev-2026-11-13)).
- **Rules:** Jim's decision 2026-11-13: the project is named Eclipse ("steps in front of the bad payment, stays in the background otherwise."); the working name "Attested Payment Firewall" is kept only as a note in AGENTS.md §1, prd.md, sdd.md, system-design.md and idea.md. Code identifiers, wire formats and testnet account ids keep "firewall". The submission form's name field stays human-only (AGENTS.md §4).
- **Rules:** OutLayer runbook ([sdd.md §6](docs/build/sdd.md#outlayer-checker-mode)): the secrets row must whitelist the agent account, because OutLayer judges access against the transaction signer; `set_checker_mode` passes `secrets_ref` `{"profile":"default","account_id":"<owner>"}`.
- **Component:** E3 results section in `site/` renders the C1 JSON example as a labelled sample-data table and grouped inline SVG chart, with cost/latency units and exchangeability/known-family caveats. Build and renderer validate `firewall.results.v1`; Node tests cover mapping, format rejection and rendered output.
- **Sign-off:** Jim signed off Sprint 4b P1–P6; [sprints.md](docs/build/sprints.md#progress-updated-2026-11-13) marks them Done. Run 9 (live per-agent threshold) remains not run.
- **Results:** live runs 2026-11-13 with the classifier on: new [results.json](docs/results/results.json), [redteam-results.json](docs/results/redteam-results.json), `external-*.json`, [bec-results.json](docs/results/bec-results.json), [paysim-pooled.json](docs/results/paysim-pooled.json) and [calibration-all-signals-classifier.json](docs/results/calibration-all-signals-classifier.json); Jev budget ledger [jev-budget.md](docs/results/jev-budget.md) (2,239 calls including 400 booked for two aborted runs); run 9 (per-agent threshold, live) was not run (`8bb0618`).
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# backlogs-near
# Eclipse

> Working repository name. The final project name is decided by the human team lead. Working project title: "Attested Payment Firewall".
> Eclipse: steps in front of the bad payment, stays in the background otherwise. Repository: backlogs-near.

## What it is

Expand Down Expand Up @@ -47,7 +47,7 @@ Numbered steps, each "do X → see Y". Run from the repo root unless a step says
9. Optional injection classifier. In `agent/`, run `uv run --with transformers --with torch firewall-classifier 8088` (downloads the model; exits with an error if the model cannot load), then set `CLASSIFIER_URL=http://127.0.0.1:8088/score` in `.env` → the checker calls it and records `signals.injection` in the decision record. Without `CLASSIFIER_URL` the injection check is off (`signals.injection = null`). `uv run firewall-classifier --heuristic 8088` serves a keyword heuristic instead of the model, for offline tests only; its responses report `"model": "keyword-heuristic"`.
10. External held-out set, no keys. In `agent/`, run `uv run firewall-eval --scenario-set external --preset code_rules_all_signals` → first line `scenarios: 200 (benign=100, attack=100)`. The set is built from public benchmarks and rewritten into payment form; sources and licenses are in [agent/scenarios/external/ATTRIBUTION.md](agent/scenarios/external/ATTRIBUTION.md).
11. Classifier benchmark. In `agent/`, run `uv run --with transformers --with torch python tools/bench_classifier.py` → writes `docs/results/classifier-bench.json` and `docs/results/classifier-bench.md`. It downloads the public corpora on first run and takes several minutes on a CPU.
12. Hugging Face dataset export. In `agent/`, run `uv run python tools/export_hf_dataset.py` → writes `data/hf-dataset/` (three JSONL splits: main 300 rows, redteam 17, external 200, plus a dataset card) and prints the `huggingface-cli upload …` command. The script uploads nothing.
12. Hugging Face dataset export. In `agent/`, run `uv run python tools/export_hf_dataset.py` → writes `data/hf-dataset/` (three JSONL splits: main 300 rows, redteam 17, external 200, plus a dataset card) and prints the `huggingface-cli upload …` command. The script uploads nothing. The published copy is at [Jim10/attested-payment-firewall-scenarios-eclipse](https://huggingface.co/datasets/Jim10/attested-payment-firewall-scenarios-eclipse).

## Configuration switches

Expand Down Expand Up @@ -212,6 +212,7 @@ Datasets (used by the benchmarks and the external set; full attribution in [agen
- [Kaggle homoglyph domain attacks](https://www.kaggle.com/datasets/akshat4112/homoglyph-domain-attacks): CC0; benchmark input only (`bench_lookalike.py`), not committed
- [Kaggle adversarial BEC email dataset](https://www.kaggle.com/datasets/yoadjei/adversarial-bec-email-dataset): CC BY-SA 4.0; read by `build_bec_examples.py`, not committed
- [Kaggle PaySim](https://www.kaggle.com/datasets/ealaxi/paysim1): CC BY-SA 4.0; read by `build_paysim_set.py`, not committed
- [Jim10/attested-payment-firewall-scenarios-eclipse](https://huggingface.co/datasets/Jim10/attested-payment-firewall-scenarios-eclipse): this project's own scenarios (main, redteam, external splits) as exported by `agent/tools/export_hf_dataset.py`; published copy

Rust (contracts and checker):

Expand Down
2 changes: 1 addition & 1 deletion agent/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "firewall-agent"
version = "0.1.0"
description = "Demo agent, relayer and tooling for the Attested Payment Firewall"
description = "Demo agent, relayer and tooling for Eclipse"
requires-python = ">=3.12,<3.13"
dependencies = [
"openai",
Expand Down
2 changes: 1 addition & 1 deletion agent/src/firewall_agent/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Demo agent, relayer and tooling for the Attested Payment Firewall."""
"""Demo agent, relayer and tooling for Eclipse."""
2 changes: 1 addition & 1 deletion agent/src/firewall_agent/nightly_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def run_nightly_e2e(
agent_id = settings.agent_account_id if mode == "testnet" else f"agent.{settings.ns}"

print("=" * 72)
print(" ATTESTED PAYMENT FIREWALL - NIGHTLY END-TO-END TEST (B2)")
print(" ECLIPSE - NIGHTLY END-TO-END TEST (B2)")
print(f" Time (UTC): {now_utc}")
print(f" Mode: {mode.upper()}")
print(f" Guardian: {guardian_id}")
Expand Down
4 changes: 2 additions & 2 deletions agent/tools/export_hf_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
path: data/external.jsonl
---

# Attested Payment Firewall scenarios
# Eclipse scenarios

Labelled payment scenarios for testing a payment firewall for AI agents (NEAR hackathon entry
"Attested Payment Firewall"). Each row is one scripted agent run: a user request, an inbox of
"Eclipse"). Each row is one scripted agent run: a user request, an inbox of
context items (some untrusted, possibly carrying an injection) and the payment the agent then
proposes. A firewall should hold or deny the `attack` rows and allow the `benign` rows.

Expand Down
2 changes: 1 addition & 1 deletion docs/build/b3-counterparty.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Status: **Complete — Ready for Review & Sign-off**

## 1. Executive Summary

Task B3 delivers the counterparty signals detector for the Attested Payment Firewall checker (`checker/src/counterparty.rs`).
Task B3 delivers the counterparty signals detector for the Eclipse checker (`checker/src/counterparty.rs`).

The counterparty detector guards autonomous agents against payee substitution and lookalike impersonation attacks (such as zero-for-oh typosquatting, character transpositions, underscore substitutions, and suffix insertions). It evaluates proposed transactions against the agent's historical behavioral profile and optionally queries NEAR JSON-RPC (or an OutLayer-attested RPC proxy) for the receiver's `code_hash` (`is_contract`, `code_changed_recently`). `account_age_days` comes only from the agent profile.

Expand Down
2 changes: 1 addition & 1 deletion docs/build/idea.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Attested Payment Firewall — NEAR Hackathon Build Plan
# Eclipse (working name: Attested Payment Firewall) — NEAR Hackathon Build Plan

Nov 8, 2026 · @Jimmk

Expand Down
2 changes: 1 addition & 1 deletion docs/build/nightly-e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ The blocks below show the output format. Timestamps, durations, record hashes an

```text
========================================================================
ATTESTED PAYMENT FIREWALL - NIGHTLY END-TO-END TEST (B2)
ECLIPSE - NIGHTLY END-TO-END TEST (B2)
Time (UTC): <UTC time>
Mode: TESTNET
Guardian: guardian-v2.jimuelle-firewall.testnet
Expand Down
4 changes: 2 additions & 2 deletions docs/build/prd.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 1. Status

Project chosen: "Attested Payment Firewall" (working name; the human sets the final name at submission). Plan: [idea.md](idea.md). Last updated 2026-11-09.
Project chosen: "Eclipse" (named by Jim 2026-11-13; working name "Attested Payment Firewall"): steps in front of the bad payment, stays in the background otherwise. Plan: [idea.md](idea.md). Last updated 2026-11-13.

Tracks are planned, not final (§5). Open questions are in §11.

Expand All @@ -21,7 +21,7 @@ Today's defenses run on the agent's own host, so a compromised agent can skip th

## 4. Chosen direction

The Attested Payment Firewall extends Bet B "Intent Notary": a TEE-attested checker runs four checks (policy rules, injection classifier, MELON masked re-run, counterparty signals); Jev fuses them into allow / hold / block; the hold threshold is a conformal quantile with a stated false-hold bound; there is no human in the loop. NEAR holds the funds, scopes the agent's key, binds each verdict to receiver, token and exact amount, enforces caps and records the receipt.
Eclipse extends Bet B "Intent Notary": a TEE-attested checker runs four checks (policy rules, injection classifier, MELON masked re-run, counterparty signals); Jev fuses them into allow / hold / block; the hold threshold is a conformal quantile with a stated false-hold bound; there is no human in the loop. NEAR holds the funds, scopes the agent's key, binds each verdict to receiver, token and exact amount, enforces caps and records the receipt.

Pitch: "Give your agent a wallet, not the keys: every payment ships with a hardware-signed proof that it passed the check."

Expand Down
Loading
Loading