微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🛡️

可验证的人类操作证明系统

SanctifAI Trust · v1.0.1
入口已确认,内容待校验 文件树里有 SKILL.md,但正文还没采回,frontmatter 未核对。
专业技能 安全 A 级 作者 sanctifai 公开目录收录
236 下载 0 安装 1k 收藏 2 浏览

简介

SanctifAI Trust 提供基于 WebAuthn 的加密人类操作证明,通过零知识哈希承诺与区块链锚定,为金融审核、内容审批等场景生成防篡改的参与证书。

原始描述

Integrate SanctifAI Trust Proof-of-Human attestations. Use when an app needs cryptographic proof a human performed a task or human-in-the-loop verification.

通过你的 Agent 添加

安装目录:sanctifai-trust/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/sanctifai-trust/
Codex CLI~/.codex/skills/sanctifai-trust/
DeepSeek Harness~/.agents/skills/sanctifai-trust/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

SanctifAI Trust 是一项用于生成可验证「人类操作证明」的服务,核心场景包括:金融转账审批、内容审核确认、代码发布签字、零工任务完成验证等。系统集成分为两条路径:

嵌入式路径(推荐):适用于开发者自有应用。需在后端配置 TRUST_TENANT_ID 和 TRUST_API_KEY,通过 REST API 创建 presence session,浏览器端完成 WebAuthn 认证(Touch ID / Windows Hello / Passkey),最终获得 participation_id 和可公开验证的 certificate_url。

扩展路径:适用于第三方平台或外部工作者。工作者安装 SanctifAI Chrome 扩展并自行配置身份凭证,宿主页面仅需引入托管脚本 sanctifai-presence.js,无需处理 API 密钥。

数据隐私设计采用客户端哈希策略:taskData 和 resultData 在浏览器内完成 SHA-256 哈希(0x 前缀十六进制),仅承诺值上链,原始数据永不离开本地。

显著优点

  1. 零知识隐私保护:原始任务数据通过 SHA-256 承诺上链,证书仅展示元数据和哈希,满足 GDPR/CCPA 合规要求。
  2. 抗冒充的硬件级认证:基于 WebAuthn/Passkey 的生物学特征绑定(指纹、面容、PIN),比传统 OTP 或短信更难伪造。
  3. 双重可验证性:链下证书 URL 提供即时验证,链上 Ethereum Attestation Service(Base 网络)提供长期不可篡改存证。
  4. 无 PII 泄露风险:设计强制要求 user_id 使用不透明内部标识(如 emp_a8f3c2),禁止邮箱、姓名等直接进入证书。
  5. 灵活集成:嵌入式路径提供完整 REST API 控制;扩展路径实现「零后端改动」的轻量接入。

潜在缺点与局限性

  1. 浏览器环境强依赖:navigator.credentials 要求现代浏览器(Chrome/Edge/Safari/Firefox),服务端或原生应用无法直接调用。
  2. 设备级注册门槛:每个设备需先完成一次 Passkey 注册(enrollment),未注册用户会遇到 404 No WebAuthn credentials found,需引导完成注册流程。
  3. RP ID 严格绑定:rp_id 必须预先在租户控制台注册,跨域或子域名变更需重新配置,否则触发 CORS/allowlist 错误。
  4. 分类代码学习成本:task_type 和 domain 为固定 3 字母枚举代码(如 EVA、MED),非直观描述,需查阅 reference.md 映射表。
  5. 试用配额限制:免费 7 天试用仅支持 1 租户、10 用户、100 次证明,生产规模需升级付费计划。
  6. 区块链 Gas 成本:虽然文档未明确说明,但 EAS 链上锚定涉及 Base 网络交易费用,高频使用需考虑成本。

适合的目标群体

  • 金融科技企业:需要审计追踪的转账审批、合规签字、KYC 复核等场景。
  • 内容平台与审核团队:人工审核内容的「人机分离」证明,防止 AI 冒充人工决策。
  • 企业合规与法务部门:合同审批、发布签字、内部控制节点的可验证留痕。
  • 零工经济与众包平台:验证任务确实由指定工作者完成,防止机器人刷单。
  • 高安全需求的基础设施团队:CI/CD 发布签字、数据库变更审批等 DevSecOps 场景。

使用风险

  1. API 密钥泄露风险:TRUST_API_KEY 一旦暴露到客户端 JavaScript,将导致租户级未授权访问。必须严格遵循「后端 mint session」模式。
  2. 误用 Demo 环境:开发者常错误指向 http://localhost:3000 文档站点而非生产 API https://trust.sanctifai.com,导致难以调试的 CORS/origin 错误。
  3. PII 污染证书:违反「证书即公开」原则,将姓名、邮箱、账号等放入 task_subtype 或 taskData,造成不可撤销的隐私泄露。
  4. 单点故障依赖:SanctifAI 服务端可用性直接影响证明生成,虽然链上锚定提供最终性,但实时验证依赖其证书服务。
  5. WebAuthn 用户体验差异:不同平台(iOS/Android/Windows/macOS)的 Passkey 体验不一致,可能导致用户流失或支持成本上升。
  6. 代码枚举维护负担:task_type/domain 的 3 字母代码若与业务系统枚举不同步,将导致 API 400 错误,需建立代码映射层。

技能正文


name: sanctifai-trust-proof-of-human description: Integrate SanctifAI Trust Proof-of-Human attestations. Use when an app needs cryptographic proof a human performed a task or human-in-the-loop verification. homepage: https://trust.sanctifai.com

SanctifAI Trust — Proof of Human

SanctifAI Trust turns a unit of human work into a verifiable Proof of Human attestation: a person confirms presence with WebAuthn (Touch ID / Windows Hello / passkey), and the platform records a privacy-preserving participation plus an optional on-chain seal and a public certificate URL + QR code. Raw task data never leaves the browser — only 0x+SHA-256 commitments are sent.

Use this skill when a user wants to prove a human did something (approved a wire, reviewed content, signed off a release, completed a gig task) and get a participation_id + certificate_url back.

No package install required. You integrate by calling the REST API directly (embedded path) or by including one hosted <script> (extension path). Base API: https://trust.sanctifai.com.

Step 0 — Use the production API (not a local Trust instance)

Set TRUST_API_BASE_URL=https://trust.sanctifai.com and call that. A Trust site running on http://localhost:3000 is the docs/demo site — treat it as documentation, not the API target, unless you have explicitly confirmed it runs the full API with your tenant's origin allowlist. Pointing integration at a local Trust instance is a common one-shot failure: it causes origin-allowlist and CORS errors that look like API bugs. Unless told otherwise, target production.

Step 1 — Get tenant credentials first (don't skip to the extension)

Embedded integration needs two tenant credentials that live only on your backend:

TRUST_TENANT_ID=your_tenant_id   # ≤ 12 chars
TRUST_API_KEY=sk_live_...        # tenant-scoped secret — NEVER in client code

If you don't have a Tenant ID or API key yet

Sign up at https://trust.sanctifai.com. New accounts go through an onboarding wizard that starts a free 7-day trial and provisions what you need:

  • 1 tenant (with Tenant ID)
  • 1 default API key (sk_live_…) — copy it during setup; it is shown once
  • Plan limits on the trial: 1 tenant, 10 users, 100 attestations

After signup, open Console → Tenants → Manage to create additional API keys or copy your Tenant ID. Store both values in your backend environment (.env / secret manager), not in client code or agent chat logs you don't trust.

If the integrator already has credentials, write them into the backend at build time. If they don't, direct them to trust.sanctifai.com — do not guess or fabricate IDs.

Do not fall back to the Extension path just because you lack an API key. A missing key is not a reason to assume the worker will supply one. Obtain the credentials via the Trust console (or ask the user for values they received there) and build embedded — it is the default. Whatever origin runs the attestation must be on the tenant's allowlist (see Hard rules / reference.md).

Step 2 — Pick the integration path (only if embedded is genuinely impossible)

Ask exactly one question: does the integrator control the app where the human works?

        Does the integrator CONTROL the app where the human works?
                                 │
        ┌────────────────────────┴────────────────────────┐
       YES — their own app / employees          NO — a 3rd-party app they don't
        │                                         control, or external/BYO workforce
        ▼                                              ▼
   EMBEDDED (app-bound) ← DEFAULT                 EXTENSION (worker-bound)
   • WebAuthn runs in THEIR page                 • WebAuthn runs in the worker's
   • API key stays on THEIR backend                SanctifAI Chrome extension
   • THEY supply user_id                          • the WORKER supplies identity
   • REST API, no extension                       • one hosted <script>, no API key
   (REST: /api/presence/*)                        (script: sanctifai-presence.js)

Both paths produce the same participation + certificate. Default to embedded. Choose Extension only when the humans are genuinely external / bring-your-own workforce, or the app is not controlled by the integrator — never merely because a credential is missing.

Taxonomy codes (hard rule — wrong values fail)

task_type and domain are fixed 3-letter taxonomy codes, validated as enums. Descriptive strings are rejected.

  • task_type (required): one of ENT ANN COL RND EVA RPA ORC GEN MOD STT TRA DSN DEV CXO SLS CMP ANA PMT CUR. Default GEN.
  • domain (optional): one of GEN AUT DFS EDU ENE FIN INS HRM HOS LOG TRN LEG MED MDA RTL ROB SPT TEC GOV AGR REA TEL ESG. Default GEN.
  • task_subtype (optional): free-text label, max 200 chars — this is where a human-readable description goes (it renders as the certificate title).
# WRONG — descriptive label in a code field → rejected
task_type: "PHARMABOT_TREATMENT_REVIEW"

# RIGHT — codes in the code fields, label in task_subtype, detail in taskData
task_type:    "EVA"
domain:       "MED"
task_subtype: "Treatment plan review"
# full details go inside taskData/resultData BEFORE hashing

The full code lists with labels live in reference.md.

What's in an attestation record (and why you pass each field)

Trust splits data across three layers: what you send at integration time, what SanctifAI stores (participation database + public certificate), and what is anchored on-chain (Ethereum Attestation Service on Base). Raw taskData / resultData never leave the browser — only salted SHA-256 commitments and selected metadata.

Fields you supply (POST /api/presence/start — embedded path)

Field Public certificate On-chain (EAS V3) Trust DB Why you pass it
tenant_id Yes No — tenant commitment only Yes Scopes the proof to your Trust tenant
user_id Yes No Yes Binds the human reviewer — use an opaque internal ID, not PII
task_id Yes No — task commitment only Yes Stable id for the unit of work / idempotency
task_type Yes (label) No Yes 3-letter taxonomy — category of human work
domain Yes (label) No Yes 3-letter industry/domain code
task_subtype Yes (headline) No Yes Short certificate title — no PII
task_commitment Yes (hash) Yes (taskCommitment) Yes Proves task payload without revealing it
result_commitment Yes (hash) Yes (resultCommitment) Yes Proves outcome/decision without revealing it
human_fp Yes Yes (humanFingerprint) Yes Pseudonymous WebAuthn / passkey fingerprint
bond_eligible Yes Yes Yes Whether attestation may back a bond product
rp_id / origin RP ID on cert No Yes Domain binding and allowlist enforcement
idempotency_key No No Yes Required — UUID (crypto.randomUUID()) that de-dupes retries; add it on the backend. Missing/non-UUID → 400
taskData / resultData No (hashed only) No No raw copy Hashed client-side; plaintext never sent

Optional customer_id (UUID) may appear on the certificate if supplied — still must not contain or encode PII.

On-chain EAS attestation (V3 — public on Base)

On-chain field Comes from Purpose
taskCommitment Client SHA-256 of task payload Tamper-evident task binding without disclosure
humanFingerprint WebAuthn enrollment Proves the same human authenticator signed
tenantCommitment Salted hash of tenant_id Links proof to tenant without publishing the slug
resultCommitment Client SHA-256 of result payload Tamper-evident outcome binding
ts Anchor time When the proof was sealed
bondEligible Request flag Bond-eligibility marker

Plain tenant_id and task_id strings are not written to chain in V3 — only their commitments (plus humanFingerprint and timestamps).

After presence/verify — what the integrator gets back

Field Purpose
participation_id Primary ID — certificate URL, QR, and API lookups
certificate_url Public proof page anyone can open and verify
qr_url QR seal image for your UI
verification_url EAS Scan / block explorer link when anchored
human_fp Reviewer's pseudonymous fingerprint (same as enrolled passkey)

Privacy rule of thumb

Treat the certificate URL as public. If you would not publish a value there, do not put it in user_id, task_subtype, task_id, or inside taskData/resultData (hashes are public; metadata above is shown on the cert). Store human-readable detail in your own systems; keep Trust payloads pseudonymous.

Step 3a — Embedded (app-bound): call the REST API directly

The Trust API key must never reach the browser. Mint the presence session on the integrator's backend (it holds the key) and pass only the session_id to the page. presence/options and presence/verify are authorized by session_id, so the browser never needs the key.

Embedded minimum flow (don't ship attestation-only)

A complete embedded integration enrolls the reviewer, then attests:

1. Register the reviewer's passkey if they don't have one on this device
   (POST /api/webauthn/registration/options + /verify — see reference.md).
2. Start the presence session (backend; holds the API key).
3. Fetch presence options.
4. Prompt navigator.credentials.get().
5. Verify the credential → participation.
6. Display participation_id, certificate_url, and the qr_url QR image.

Skipping step 1 is the most common one-shot failure: for a reviewer who hasn't enrolled, presence/options returns 404 No WebAuthn credentials found. Treat that 404 as the trigger to run enrollment inline (step 1), then retry the presence flow — no separate "is enrolled?" check needed.

registration/verify needs more than the credential. Send tenant_id, user_id, rp_id, and challenge_id alongside credential — and the credential must include clientExtensionResults (cred.getClientExtensionResults?.() ?? {}). Omitting any required field is a 400. Full enrollment example in reference.md.

Backend (server-side; holds TRUST_API_KEY):

// POST /api/trust/presence/start  — your server
export async function POST(req) {
  const body = await req.json();                 // commitments + task fields from the browser
  const userId = await getEmployeeIdFromSession(req); // authorize from YOUR session, not the body
  const r = await fetch('https://trust.sanctifai.com/api/presence/start', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${process.env.TRUST_API_KEY}` },
    body: JSON.stringify({
      ...body,
      tenant_id: process.env.TRUST_TENANT_ID,
      user_id: userId,
      idempotency_key: crypto.randomUUID(),
    }),
  });
  const { session_id } = await r.json();
  return Response.json({ session_id });
}

Browser (runs WebAuthn; raw task data stays local):

// tiny helpers (WebAuthn needs base64url <-> ArrayBuffer)
const b64uToBuf = (s) => { const p = s.replace(/-/g,'+').replace(/_/g,'/').padEnd(s.length+(4-s.length%4)%4,'='); const b = atob(p); const u = new Uint8Array(b.length); for (let i=0;i<b.length;i++) u[i]=b.charCodeAt(i); return u.buffer; };
const bufToB64u = (buf) => { const u = new Uint8Array(buf); let s=''; for (let i=0;i<u.length;i++) s+=String.fromCharCode(u[i]); return btoa(s).replace(/\+/g,'-').replace(/\//g,'_').replace(/=+$/,''); };
const sha256Hex = async (d) => { const j = typeof d==='string'?d:JSON.stringify(d,Object.keys(d).sort()); const h = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(j)); return '0x'+Array.from(new Uint8Array(h)).map(b=>b.toString(16).padStart(2,'0')).join(''); };

const API = 'https://trust.sanctifai.com';

async function createAttestation(taskData, resultData, { taskId, taskType='GEN', domain='GEN', taskSubtype } = {}) {
  // 1. hash inputs locally — raw data never leaves the page
  const task_commitment = await sha256Hex(taskData);
  const result_commitment = await sha256Hex(resultData);

  // 2. mint the session via YOUR backend (keeps the API key server-side)
  const { session_id } = await fetch('/api/trust/presence/start', {
    method: 'POST', headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      task_id: taskId ?? `task-${Date.now()}`,
      task_type: taskType, domain, task_subtype: taskSubtype, // codes only; label in task_subtype
      task_commitment, result_commitment, bond_eligible: true,
      rp_id: location.hostname, origin: location.origin,
    }),
  }).then(r => r.json());

  // 3. fetch WebAuthn options
  const { options } = await fetch(`${API}/api/presence/options`, {
    method: 'POST', headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ session_id }),
  }).then(r => r.json());

  // 4. prompt the platform authenticator
  const cred = await navigator.credentials.get({ publicKey: {
    ...options,
    challenge: b64uToBuf(options.challenge),
    allowCredentials: (options.allowCredentials || []).map(c => ({ ...c, id: b64uToBuf(c.id) })),
  }});

  // 5. verify + create the participation
  return fetch(`${API}/api/presence/verify`, {
    method: 'POST', headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ session_id, expedite: true, credential: {
      id: cred.id, rawId: bufToB64u(cred.rawId), type: cred.type,
      clientExtensionResults: cred.getClientExtensionResults?.() ?? {},
      response: {
        clientDataJSON: bufToB64u(cred.response.clientDataJSON),
        authenticatorData: bufToB64u(cred.response.authenticatorData),
        signature: bufToB64u(cred.response.signature),
        userHandle: cred.response.userHandle ? bufToB64u(cred.response.userHandle) : null,
      },
    }}),
  }).then(r => r.json()); // -> { participation_id, certificate_url, qr_url, ... }
}

Each reviewer must enroll a passkey once per device before attesting — see reference.md (enrollment, the Origin-forwarding rule for proxied enrollment, and CORS/proxy notes).

Step 3b — Extension (worker-bound): one hosted script

The worker installs the SanctifAI Chrome extension and configures their own tenant id, user id, API key, and RP id. Your page includes only the hosted bridge script — it never holds per-worker secrets and supplies no user_id.

<script src="https://trust.sanctifai.com/sanctifai-presence.js"></script>
<script>
  await SanctifAIPresence.waitForReady(5000);
  const result = await SanctifAIPresence.createAttestation({
    taskData: { item: 'POST-913', content: '…' }, // hashed client-side
    resultData: { decision: 'approved' },          // hashed client-side
    taskType: 'GEN', // optional, taxonomy code
  });
  // result.participation_id, result.certificate_url, result.qr_url
</script>

The script exposes createAttestation, detectExtension, isReady, waitForReady, and sha256Hex on window.SanctifAIPresence. Identity comes from the worker's extension config, so the attestation binds to the worker and is portable across the customers they work for.

Hard rules

  1. Default to embedded; obtain credentials, don't dodge to the extension. Embedded needs TRUST_TENANT_ID + TRUST_API_KEY on the backend — have them or prompt the user. A missing key is never a reason to pick the extension.
  2. Target production https://trust.sanctifai.com. A local Trust site is docs only unless confirmed to run the full API with your tenant allowlist.
  3. Never ship a Trust API key to client JavaScript. Embedded → mint the session on the backend. Extension → the key lives in the worker's extension.
  4. task_type / domain are fixed 3-letter codes (see Taxonomy codes). Descriptive labels go in task_subtype (≤ 200 chars) or inside taskData/resultData before hashing — never in a code field.
  5. taskData / resultData stay raw on the client — they are hashed into 0x+SHA-256 commitments; only hashes are transmitted.
  6. No PII on the public certificate. Fields that can appear on the certificate or proof URL — especially task_subtype, labels inside taskData/resultData, and any display metadata — must not contain personally identifiable information (names, emails, phone numbers, account numbers, government IDs, full addresses, etc.). Use opaque internal IDs for user_id (e.g. emp_a8f3c2, not jane.doe@company.com). The Tenant ID is already scoped to the integrator; do not embed customer PII in tenant-facing attestation payloads. Put human-readable detail in your own app/database; keep Trust payloads pseudonymous.
  7. Register production origin(s) + RP ID with the tenant, or the API's allowlist rejects the domain.
  8. rp_id is the hostname only (e.g. app.example.com, or localhost in dev).
  9. The attestation step runs in a browser (it calls navigator.credentials).

Before you ask the user to test (smoke test)

Sanity-check the wiring without completing a real attestation:

- POST /api/webauthn/registration/options  → returns challenge_id + options
- POST /api/presence/start                  → returns session_id
- POST /api/presence/options                → returns options.challenge

If any of these returns HTML, a 401/403, or a CORS error, fix the base URL, API key, or origin allowlist before going further — don't prompt the user yet.

UI acceptance criteria

A complete UI shows, after a successful attestation:

- participation_id
- certificate_url  (clickable link — open it to confirm the public proof renders)
- qr_url           (rendered as a QR image, not just a link)
- verification_url (if present — the on-chain explorer link)
- clear error guidance when the reviewer has not enrolled a passkey

Verify it worked

A successful call returns JSON with a non-empty participation_id and a certificate_url. Open the certificate_url to confirm the public proof renders.

Deeper material

  • reference.md — REST endpoints, full taxonomy code lists, obtaining credentials, one-time passkey enrollment, the Origin-forwarding rule for proxied enrollment, error/troubleshooting tables, CORS/same-origin-proxy guidance, response shapes.
  • Docs: https://trust.sanctifai.com

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

securityauthenticationblockchainfinance-accountinglegalproduct-managementoperationsapibackendfrontend

同类 Skill