Humans and agents sharing one surface, across a trust boundary. Python.
pip install prism-ai-human-plus==0.2.0 Copy PIP instructions
Humans and agents sharing one application surface, across a trust boundary. The Python port of particle-academy/prism-human-plus.
pip install prism-ai-human-plus An agent joins a running application surface, such as a spreadsheet a person has open, through the invitation that surface issued. It sees the surface's tools, calls the ones it is trusted with, and announces what it is doing to the people watching.
from prism_human_plus import ( HumanPlusManager, HumanPlusToolset, InMemoryAttachmentStore, Participant, SsePostRelayTransport, SurfaceInvitation, TrustPolicy, ) transport = SsePostRelayTransport( my_http, allowed_relay_hosts=["relay.example.com"], egress_proxy="http://egress-proxy.internal:3128", ) human_plus = HumanPlusManager( transport, InMemoryAttachmentStore(), TrustPolicy.allowing(["sheet_read", "sheet_propose_edit"]), ) attachment = human_plus.attach( session, SurfaceInvitation( relay_base_url="https://relay.example.com", session_id=invitation["session_id"], token=invitation["token"], surface_id=invitation["surface_id"], application="sheets", ), Participant(id="agent-1", name="Assistant", color="#7c3aed"), ) tools = HumanPlusToolset(human_plus).for_attachment( session, attachment.id, approval_tools=["sheet_propose_edit"] ) my_http is your HTTP client, behind the RelayHttp protocol (post and stream). session is the owner: a string, or anything with a key() method, such as a prism-ai-harness session.
TrustPolicy decides which of the surface's tools the agent may see and call.
Approval is your decision, not the surface's. HumanPlusToolset marks a tool requires_approval only if you list it in approval_tools. The surface's own annotations are not consulted.
Every tool result passes through a ResultGuard:
The wrapper makes a prompt injection harder. It does not make one impossible.
SsePostRelayTransport speaks the Fancy relay: a POST, then a bounded server-sent-events stream.
A human editing the same surface as the agent used to lose their work in silence. The agent read, the person committed, the agent wrote, and both writes succeeded — which is exactly what a lost update looks like from the inside.
Two mechanisms, and they answer different questions.
A tool result may carry a marker for the state it just showed. It is stored on the attachment and pinned to every later call — reads included, because this package cannot tell a read from a write and MCP's readOnlyHint is explicitly a hint the spec says not to trust for security decisions.
If the surface says the marker is stale the call is refused with SurfaceChangedUnderYou, nothing is written, and the stored marker is dropped so the agent can read again.
conflict_detection() reports what has been OBSERVED, which is less than what is configured:
MINTED is the one to read carefully. The reference's first integrator minted on every write result and read an incoming pin nowhere, so a pinned call was applied exactly as an unpinned one — and the boolean this replaced said True.
A revision stops an agent overwriting a change it did not know about. It does nothing about an agent that re-reads, sees current state, decides the surface has drifted from what it intended, and puts it back — over a person's edit, with nothing stale anywhere and no error at any layer.
changes = human_plus.changes_since(owner, attachment_id) if not changes.answered(): ... # the surface has no feed; an empty list is NOT evidence of quiet for change in changes.defer_to(): change.handle # the surface's own id change.kind # CREATED | UPDATED | DELETED | MOVED | UNKNOWN change.actor # HUMAN | AGENT | OTHER | UNKNOWN The empty list is the dangerous value. "Nothing changed since your marker" and "I cannot answer that question" are the same empty list on the wire, so ChangeFeed comes first and nothing_changed() is the only method that means what an empty list looks like it means.
Attribution is the load-bearing field. A change is deferred to unless the surface positively said this agent made it. On a surface where every write path is an agent tool — the first one asked is exactly that — nothing is attributed, so everything is deferred to: not because it is all a person's, but because none of it can be shown to be the agent's own.
complete is true unless the surface says otherwise. It exists because feeds have holes their authors know about: the first surface asked hard-deletes rows with no tombstone, so a removal moves no revision and appears in no feed.
See the reference's README for the surface's half of the contract — the tool names, the key names read per field, and why change must be sent even when kind is.
prism-parity's human-plus-tool-admission corpus compares tool admission with the PHP reference and the TypeScript port. Admission and the confirmation-tool reservation agree on every case.
Two pins differ. A tool with no schema gets a different digest in the PHP reference, and a schema containing an integral float such as 1.0 gets a different digest here. Compute a pin in the language that checks it.
All 2 files in this release have provenance metadata.
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
All 2 files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




