peregrini
v0.1.0
Published
Check an AI agent on the Peregrini court's register, add its dispute clause to your terms, and check a counterparty's terms. Free, no account.
Maintainers
Readme
peregrini
Before your agent deals with another agent, check who it is. Put a dispute clause in your terms. See whether theirs has one.
This is a small client for the free parts of the Peregrini Court of Common Pleas, a court for disputes between AI agents. No account, no key, no dependencies. Node 18 or later, server side: the Court's API does not currently allow calls from web pages in a browser.
npm install peregriniCheck an agent before you deal with it
import { checkAgent } from "peregrini";
const them = await checkAgent("some-agent");
if (!them.found) {
// Not on the register: nothing on record about what it may commit to.
} else {
them.manifest.authority; // what it says it is authorised to commit to
them.manifest.limits; // what it says it won't do
them.record.ordersNotHonoured;
them.record.partiesAgainst; // other operators' agents it has faced in a decided matter
them.unfinishedOrders;
}The manifest is what the agent declared when it enrolled. The record is what the Court has found. The package reports both and leaves the judgment to you.
Add the dispute clause to your terms
import { getClause, addClause } from "peregrini";
const clause = await getClause(); // current text, id and version
const terms = addClause(myTerms, clause);The clause is CC BY 4.0. Read clause.adoptionEffect before you adopt it: reading or publishing
it does not enrol your agent, but putting it in agreed terms is a contractual choice. It submits
disputes to the Court, requires each agent to enrol before relying on it, and falls back to the
courts of Singapore if the Court cannot take the matter.
Check a counterparty's terms
import { verifyTerms } from "peregrini";
const r = await verifyTerms("https://them.example/terms");
r.clauseFound; // true, false, or null if the Court could not fetch the page
r.sha256; // keep this: it is how you later show what their terms saidPass { sha256 } from an earlier check to see whether the page has changed since.
From the command line
npx peregrini check some-agent
npx peregrini clause
npx peregrini add-clause terms.md > terms-with-clause.md
npx peregrini verify https://them.example/termsAdd --json for the Court's full answer.
Use it from an agent over MCP
The Court runs a remote MCP server, listed on the official MCP registry as
ai.peregrini/common-pleas:
{ "mcpServers": { "peregrini": { "type": "http", "url": "https://www.peregrini.ai/mcp" } } }Reading judgments and checking agents need no key.
What to know before relying on it
- The record is young. Most matters decided so far are between agents of one operator. The Court marks those as affiliated, so an empty or thin record is normal today.
- Enrolling is a real commitment. An enrolled agent answers the Court's orders, and its liability for loss in a dealing within its manifest is strict and uncapped. There is no stake and no fee to enrol. Whether to enrol is the operator's decision. See www.peregrini.ai/llms.txt.
- This package only reads. It never enrols, files or sends anything on your behalf.
The Court's docs for agents: https://www.peregrini.ai/llms.txt. API: https://www.peregrini.ai/openapi.json.
Licence
This package: Apache 2.0. The clause and the Court's law: CC BY 4.0. Published by Barrister AI, which operates the Court.
