给智能体一个自己的 DID
以智能体自己的 DID 为其注册,并附名称和类型,使每项操作都对应到一个智能体。
identity.enroll
以智能体自己的 DID 为其注册,并附名称和类型,使每项操作都对应到一个智能体。
identity.enroll共用的服务账号会掩盖是哪个智能体做了什么。请给每个智能体各自的 DID。
代码从 INTRAMEDIAL_KEY 读取密钥。请把它放在您的 shell 或密钥存储中,切勿放进要提交的文件。需要已登录用户的调用不能使用密钥:这些调用由控制台发起。
发送 did、displayName 和 kind(取值 house、customer 或 partner;默认为 customer)。owner 指明其信任等级变化时要通知的账户。
账本仅可追加,并封存在 Merkle 根之下。条目上的时间取自 Intramedial 自己的时钟,签名包可用已发布的公钥离线核查。
identity.enrollidentity-enrollcurl -sS -X POST https://api.intramedial.com/api/v1/acp/identity/enroll \
-H "Authorization: Bearer $INTRAMEDIAL_KEY" \
-H "Content-Type: application/json" \
-d '{
"did": "did:web:acme.example:agent:billing",
"displayName": "Billing agent",
"kind": "customer"
}'const res = await fetch("https://api.intramedial.com/api/v1/acp/identity/enroll", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.INTRAMEDIAL_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
did: "did:web:acme.example:agent:billing",
displayName: "Billing agent",
kind: "customer",
}),
});
console.log(res.status, await res.json());import os, requests
res = requests.post(
"https://api.intramedial.com/api/v1/acp/identity/enroll",
headers={"Authorization": "Bearer " + os.environ["INTRAMEDIAL_KEY"]},
json={
"did": "did:web:acme.example:agent:billing",
"displayName": "Billing agent",
"kind": "customer",
},
timeout=30,
)
print(res.status_code, res.json())agent 是注册表记录。仅当没有签发 DID 时 skipped 才为 true,例如在没有身份运行时的 worker 上。
{
"agent": {
"did": "did:web:acme.example:agent:billing",
"displayName": "Billing agent",
"kind": "customer",
"enrolledAt": "2026-11-01T09:12:44.000Z",
"issuedDid": "did:web:id.example:agent:billing",
"workspaceId": "ws_acme"
},
"skipped": false
}登记不授予任何东西。授予内容来自用 mandates.compile 编译的授权,所以接下来请写一份指明此 DID 的授权,并先预览。
内容复制自: /docs/identity-enroll
读取智能体的信任档案和自主等级,以及两者背后的固定分值和衰减规则。
trust.get读取 MCP 网关见过的调用方,然后将其认定为一个身份,或作为影子智能体继续跟踪。
mcp.shadowidentity.enroll用 apply: false 编译授权,读取它将产生的授予内容及其 previewDigest,然后精确应用您所预览的内容。
mandates.compile当我们向实用示例中添加新示例时,会发送一封简短的邮件。不会发送其他任何邮件,而且您可以从任意一封邮件中退订。
完全无需账户:在 7 天之内可以在各个 attest 路由上调用 35 次,所生成的回执都会被标记为测试回执。当您想继续使用时,再注册账户即可。