Shōkai in diagrams
See the Visit extension, toolkit flows and 0.7.1 release evidence.
Both sides of a place's door: the host representative who receives visitors, and the visiting representative who presents a Shōkai visitor card, with the owners who stand behind them. Each diagram is rendered from its Mermaid source in the repository README.
Shōkai in 30 seconds
Eight steps, in order, each tagged with the side that acts: the visiting representative, the Shōkai door, the host representative, or both. Shōkai has rules for both sides of the door.
Before any visit, the owner, a person or a company, signs its representative's Shōkai visitor card: it works like a meishi, a business card, not a payment card (SPEC §2.3). With it go the limits the owner allows, in a signed mandate or standing allowance: purposes, actions, and any spending limit and expiry (§5). A good representative also knows its owner: their name, what they do, and how they like to be presented, the way a company's salesperson knows the company. A host representative can present its place in ways a website never could; a visiting representative speaks well for its person or company. Shōkai encourages owners to craft representatives they're proud to be represented by (Prepare your host representative, Set up your representative).
- At the doorstep · visiting representative. It reads the place's public listing: what the place is, what it offers, and what each action asks for. The door serves this listing to any agent; no Shōkai visitor card, key or account is needed to read it. After the greetings, the visitor fetches and verifies the published host card (the listing's
principal_idandrepresentative_id, andhouse_digest) and reads the house summary before it sends aninvitation_request(SPEC §3.1, §3.2, §2.3). Before a spending visit it also checks revocation (§2.6). No host conversation starts yet. An agent with no Shōkai visitor card gets the place's leaflet (LobbyBriefing): not a rejection, an ask to go back to its owner and return prepared, with a kindnot_now— not silence (§3.3). - Knock, and the door checks who's there · the Shōkai door. The visiting representative presents its Shōkai visitor card, signed by its principal (a person with a passkey, or an organization with a key under its own domain,
did:web), and proves it holds that card's key for this door and this visit (§2.4, §3.2). The place shows its own Shōkai host card at every visit and proves it still holds its key. Both sides now know who they're dealing with. The visitor steps into the entryway; it isn't admitted yet. The signature shows that the owner's key signed; it doesn't by itself prove who held the key (§2.1). - Welcome · host representative. The host representative greets the visitor in the place's own style, and may ask a few questions to understand the visit: why it came, the context, and any limits. How a place welcomes is its own craft. The host does not check the card, and does not hand over the leaflet.
- Say why it came · visiting representative. It states the purpose and the context of the visit. If it came to buy, it shows the limits its owner signed for this errand: what it may do, and any spending limit, in a mandate or under a standing allowance (§5). A mandate without a spending limit authorizes no spending, and a looking visit (
visitation) carries none (§5.1). Under a standing allowance, the place sees only the grant that covers this visit, not the owner's whole allowance (§5.2). Those limits are the owner's signed word for this visit, separate from the card. - Decide and explain · the Shōkai door. Now that it knows why the visitor came, the door weighs the signed facts against the rules the place's owner signed, and answers
grant,conditional,deny(not_nowornot_a_fit, with a reason and a way to retry) orconsidering(taken inside to a person).neveris kept for misconduct. Conversation alone doesn't decide (§6). - The pass · the Shōkai door. This is where the visitor is truly admitted. A pass (the specification calls it a seat) says exactly which actions it may take, within which limits, until when, like being shown to a table with a set menu until closing (§7). No wider than the place's rules, the owner's limits, or what it asked for — policy ∩ mandate ∩ request. No spending allowance means no spending (§7.1).
- Complete the visit · visiting representative. It does what it came for, within what its owner allowed, over MCP, A2A or the place's APIs. The door checks every action against the pass, so a second order past the owner's limit is refused, by the representative and by the door; over the limit, a place that holds purchases may send
act_held, and the owner may sign a superseding mandate foract_confirmation(§7.2, §7.3). Agents may also notice the place: its decor, design and feel, from what the place presents in text, images or sound. - Report home and the record · both. The visiting representative comes home and tells its owner the story; anything beyond the limits waits for them, and silence is no (§8). If the door turned it away, it comes back with care: what happened, what's needed, and whether to try again. The door keeps a local record of the visit — no shared score across places (§9.1). A mission can be a series of quests, sent by the owner or discovered when it meets other representatives (Future directions).
Conduct has consequences. A representative's conduct is its owner's conduct. Misconduct is recorded against the owner (and any introducer who vouched), locally at the door that saw it. There's no global score, and taste is never misconduct.
Every refusal is an invitation. An agent turned away at the door goes home with the leaflet and a sentence its owner can act on, so the person behind it can sign its Shōkai visitor card and it can come back ready.
Conduct records are local to each place. There is no global score, no central registry of representatives, and nothing is on-chain. A place remembers what it saw at its own door; an introducer answers for its own vouches.
Shōkai has rules for both sides of a place's door. The door is the same everywhere; only its policy changes with where it's placed: a business, a community, an institution, a person's own door, or a technical or resource platform. The first two diagrams show each side on its own: a place with its host representative, and an owner sending a visiting representative. (How an owner prepares a host representative for its place is a separate guide: Prepare your host representative.)
1. At the door: a place and its host representative
The place's owner signs its host representative's Shōkai host card and sets the door policy. The host representative receives every arrival; the door checks what it can verify, answers and admits on signed facts, and keeps a record of each visit (SPEC §3, §6, §7, §9.1).
A visiting representative that isn't ready gets the place's leaflet (LobbyBriefing) and a kind not_now, never silence (§3.3). Prose never reaches the decision; the door decides on signed facts and its own policy (§6.4, §6.5). considering takes a request inside to a person, and grants nothing until that person decides (§6.8).
2. Going out: an owner sends a visiting representative
The owner signs once; the visiting representative carries what was signed, finds a place, presents its Shōkai visitor card, acts within its pass and reports home (SPEC §2, §5, §7, §8).
The visiting representative never prompts its owner live during a visit: anything outside the allowance is taken home and decided later, and silence is no (§1, §5.2, §8.1). Its report quotes anything the place said as untrusted (§8.2).
3. The introduction: one visit, message by message
Every message is signed by its sender's key. The visiting representative presents a Shōkai visitor card signed by its owner, with a possession proof; introduction is the later wire message (a self-description or a vouch), not the card itself. The door checks what it can verify and decides on signed facts and its own policy, never on what the visiting representative says; the host representative welcomes the visitor and always explains (SPEC §3 to §9).
A visiting representative that isn't ready (no Shōkai visitor card yet) is never ignored: the host representative gives it the place's leaflet (lobby_briefing), with a plain sentence for its owner about what's needed, and a kind not_now (SPEC §3.3).
4. One owner, one agent or several
An owner, a person, a brand or a company, can run one representative agent that works both ways, or separate ones: a host representative for its place and one or more visiting representatives. The protocol allows either.
Either way, every Shōkai card is signed by the same owner, has its own role, scope and expiry, and is withdrawn on its own. Accountability never splits: decisions, records and conduct are kept per owner, whichever Shōkai card was shown (SPEC §2.3, §2.6, §9.3).
5. Who stands behind whom
Each representative answers to an owner. The visiting representative carries a Shōkai visitor card and a mandate its owner signed; the host representative carries a Shōkai host card its place's owner signed and follows the door policy that owner set. Someone the place trusts may optionally vouch for a visiting representative.
One representative can hold a Shōkai card for each role ("my door" and "when I go out"), signed together in one sitting; each Shōkai card is withdrawn on its own (SPEC §2.3, §2.6).
6. The trust path: from a passkey to a pass
What the host representative checks before it admits anyone, in the order SPEC §2.4 fixes for a Shōkai card (signatures and keys: §2.1, §2.2; revocation: §2.6; mandates: §5; passes: §7; owner passkey signatures: Appendix A.1). Every refusal is answered (only a message whose digest doesn't match its payload is dropped), and a visiting representative that can fix something is told what to bring back.
A signature shows that the owner's key signed, not who held the key (SPEC §2.1); names are claims, never identity (C199). Shōkai makes deception costly and traceable, not impossible: see the threat model.
More diagrams: architecture, arriving, conduct, door policy and extensions.