Counterparty check

A prototype by Claus: before an agent pays an account, it asks for a verdict and its reasons. Explored for the NEAR AI security track. No entry has been made.

Verdicts

allow: no risk signals found, the payment may be signed.

warn: something looks unusual. The reasons are returned and the caller decides.

block: a hard signal was found. The wrapper refuses to sign.

Files

src/check.js returns the verdict with its reasons.
src/wrapper.js is a refuse-to-sign wrapper around a scoped key stub.
demo/injection.js is a prompt-injection demo: one legitimate payment gets signed, two injected payment requests get refused: one by the policy block, one by the scoped key.

Run it

npm test
node demo/injection.js

Source

Source on GitHub (PR #3) · demo/injection.js · src/check.js