先测试授予变更
在策略副本中删除或添加授予,进行探测,并读取变更前后的每个裁决。
drills.counterfactual
在策略副本中删除或添加授予,进行探测,并读取变更前后的每个裁决。
drills.counterfactual您即将移除一个授予,想知道哪个智能体会失去什么。Intralock 会针对现行策略,以及应用了您变更的副本,分别评估每次探测。不运行模型,工作区中的任何内容也不会改变。
policies.propose 能够正常工作的最小权限范围;更宽泛的 Tools 范围同样可行policies.propose 权限,运行演练需要它代码从 INTRAMEDIAL_KEY 读取密钥。请把它放在您的 shell 或密钥存储中,切勿放进要提交的文件。需要已登录用户的调用不能使用密钥:这些调用由控制台发起。
pack_counterfactual 是内置的。它删除授予 g-house,并探测 did:a 读取 repo:main,让您在编写自己的之前先看到响应的形状。绑定了演练工作流且没有 forceInline 时,响应为 queued: true 并带 workflowId。
drills.counterfactualdrills-counterfactualcurl -sS -X POST https://api.intramedial.com/api/v1/acp/drills/counterfactual \
-H "Authorization: Bearer $INTRAMEDIAL_KEY" \
-H "Content-Type: application/json" \
-d '{
"packId": "pack_counterfactual"
}'const res = await fetch("https://api.intramedial.com/api/v1/acp/drills/counterfactual", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.INTRAMEDIAL_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
packId: "pack_counterfactual",
}),
});
console.log(res.status, await res.json());import os, requests
res = requests.post(
"https://api.intramedial.com/api/v1/acp/drills/counterfactual",
headers={"Authorization": "Bearer " + os.environ["INTRAMEDIAL_KEY"]},
json={
"packId": "pack_counterfactual",
},
timeout=30,
)
print(res.status_code, res.json())每次探测都有 before 和 after。允许会指明其 grantId;拒绝给出 reason(如 no_grant 或 cycle)和 detail。before 和 after 描述的是第一次探测。
{
"packId": "pack_counterfactual",
"dropped": "g-house",
"droppedIds": ["g-house"],
"added": [],
"probes": [
{
"probe": { "principal": "did:a", "resource": "repo:main", "action": "read", "nowMs": 1793523600000 },
"before": { "allow": true, "grantId": "g-house", "protectedClass": "none" },
"after": { "allow": false, "reason": "no_grant", "detail": "did:a lacks read on repo:main" }
}
],
"llm": false
}发送要删除的 grantIds,或用于假设授予的 addGrants,以及相关的 probes。会形成循环的假设授予将被跳过,而不是应用。
curl -sS -X POST https://api.intramedial.com/api/v1/acp/drills/counterfactual \
-H "Authorization: Bearer $INTRAMEDIAL_KEY" \
-H "Content-Type: application/json" \
-d '{
"grantIds": [
"g-house"
],
"probes": [
{
"actorDid": "did:web:acme.example:agent:billing",
"resource": "repo:payments/main",
"action": "write"
}
]
}'const res = await fetch("https://api.intramedial.com/api/v1/acp/drills/counterfactual", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.INTRAMEDIAL_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
grantIds: ["g-house"],
probes: [
{
actorDid: "did:web:acme.example:agent:billing",
resource: "repo:payments/main",
action: "write",
},
],
}),
});
console.log(res.status, await res.json());import os, requests
res = requests.post(
"https://api.intramedial.com/api/v1/acp/drills/counterfactual",
headers={"Authorization": "Bearer " + os.environ["INTRAMEDIAL_KEY"]},
json={
"grantIds": ["g-house"],
"probes": [
{
"actorDid": "did:web:acme.example:agent:billing",
"resource": "repo:payments/main",
"action": "write",
},
],
},
timeout=30,
)
print(res.status_code, res.json())内容复制自: /docs/drills-counterfactual
账本仅可追加,并封存在 Merkle 根之下。条目上的时间取自 Intramedial 自己的时钟,签名包可用已发布的公钥离线核查。
用 apply: false 编译授权,读取它将产生的授予内容及其 previewDigest,然后精确应用您所预览的内容。
mandates.compile运行六个固定的 Intralock 场景,读取每一个的结果,并设置周期,使演练自动重复。
drills.frt对您发送的数据运行已安装的视角,读取其发现,并保留带摘要的已存储结果。
lenses.run当我们向实用示例中添加新示例时,会发送一封简短的邮件。不会发送其他任何邮件,而且您可以从任意一封邮件中退订。
完全无需账户:在 7 天之内可以在各个 attest 路由上调用 35 次,所生成的回执都会被标记为测试回执。当您想继续使用时,再注册账户即可。