Keys for helper agents and CI
After this guide you can give a helper agent, a scheduled job, or a CI pipeline access to one product with exactly the permission it needs, and take it away again.
When to use a key
Section titled “When to use a key”A connection made by sign-in acts as you, in every organization you belong to. That is right for the agent you work with. It is too much for a job that runs unattended.
A product key is a secret that starts with eik_. It reaches one product, with
one scope, and nobody has to sign in. A key does not expire. It works until
you revoke it.
Pick a scope
Section titled “Pick a scope”Give a key the lowest scope that does its job.
| Scope | It can |
|---|---|
read |
Read the whole product: overview, capabilities, records, and search |
channels |
Everything in read, plus report runs |
propose |
Everything in channels, plus stage proposals and raise questions |
write |
Everything in propose, plus commit records directly, decide proposals, and answer and close questions |
read, channels, propose, and write each include the one before.
The Agent keys form describes each scope in plain words.
Which tools each scope reaches
Section titled “Which tools each scope reaches”| Scope | MCP tools |
|---|---|
read |
list_products, get_product_overview, get_product_capability, get_product_records, search_product_records, get_product, open_product, show_intent, show_change, show_question |
channels |
adds report_process_run |
propose |
adds propose_product_change, escalate_question |
write |
adds update_product |
A client that connects with a key is offered only the tools its scope allows.
create_product and create_product_agent_key are never available to a key.
They need a person’s connection.
Create a key
Section titled “Create a key”In the browser
Section titled “In the browser”- Open the product and choose Connections, then Agent keys.
- Give the key a label that says what uses it, such as “Release pipeline”.
- Choose what the key can do, then Generate product key.
- Copy the secret now. It is shown once. Emergent Instruments stores a hash of it and the first characters, so that you can recognise it in the list.
From your agent
Section titled “From your agent”An agent connected by sign-in can call create_product_agent_key with a name and a scope. The secret comes back once
in the result. A key cannot create another key.
Who can create which
Section titled “Who can create which”Any member of the organization can create read, channels, and propose keys. Only an organization admin can create a write key.
Use a key over HTTP
Section titled “Use a key over HTTP”A key connects directly over HTTP: the agent, script or pipeline sends it as a Bearer token, with nothing to install. An empty product’s quickstart calls this Direct CLI. The API’s base address is:
https://emergentinstruments.com/api/orgs/<org id>/productThe organization’s id and the product’s id are shown in Connections under Advanced & developer settings.
Read the product’s records, for example to archive them with a release. This
needs the read scope:
curl -sS "https://emergentinstruments.com/api/orgs/$EI_ORG_ID/product" \ -H "Authorization: Bearer $EI_PRODUCT_KEY" \ -o product.jsonThe response is one JSON object with the product’s revision, a digest, its
records, and its proposals, questions, and runs.
Report a run from a pipeline step. This needs channels or higher:
curl -sS -X POST "https://emergentinstruments.com/api/orgs/$EI_ORG_ID/product/runs" \ -H "Authorization: Bearer $EI_PRODUCT_KEY" \ -H "Content-Type: application/json" \ -d '{ "processId": "release.ship", "processTitle": "Release pipeline", "status": "completed", "summary": "Build 412 passed the release checks." }'processId is the id of the flow or capability the run belongs to. status
is running, completed, blocked, or escalated. The run appears in the
product’s Runs & audit tab.
Errors
Section titled “Errors”| Status | error |
Meaning |
|---|---|---|
| 401 | invalid_token |
The key is unknown or revoked |
| 402 | payment_required |
The key’s organization is not on a paid plan |
| 403 | access_denied |
The address names another organization or product |
| 403 | insufficient_scope |
The key’s scope is too low. The body names both |
Use a key from an MCP client
Section titled “Use a key from an MCP client”Only for an MCP client that cannot sign in. Most apps should add the
Connector instead and sign in, with no key (see the
Quickstart). The agent address also takes the same
Bearer token. In a client that reads an mcpServers JSON file:
{ "mcpServers": { "emergent-instruments-jot": { "type": "http", "url": "https://mcp.emergentinstruments.com/mcp", "headers": { "Authorization": "Bearer eik_..." } } }}The key already names its product, so tools need no product_id. Passing another
product’s id is refused.
Store the key as a secret in your CI system, never in the repository. Use one key for each pipeline, so that revoking one does not stop the others.
What a pipeline can do with a key is read the product, report a run,
and, with propose, stage a proposal for a person to review.
Revoke a key
Section titled “Revoke a key”Open Connections, then Agent keys. Each key shows its label, its first characters, when it was created, and when it was last used. Choose Revoke. The key stops working at once.
A member can revoke the keys they created. An organization admin can revoke any key in the product.
Keep keys safe
Section titled “Keep keys safe”- Treat a key like a password. Anyone who has it can do what its scope allows in that product.
- Do not give a
writekey to anything you would not let change the product without review. - A key moves with its product when an admin moves the product to another organization.