본문으로 건너뛰기
Skillpedia
보안41k · #6787

signed-audit-trails-recipe

하는 일

이 도구는 AI 에이전트가 수행하는 모든 작업의 안전하고 검증 가능한 기록을 만듭니다. 각 작업은 보안 규칙과 대조된 뒤 디지털 서명되므로, 누구든 기록이 변조되지 않았는지 확인할 수 있습니다.

사용하는 경우

  • ✓금융이나 의료처럼 규제가 있는 분야에서 에이전트의 행동을 증명해야 할 때.
  • ✓자동화된 개발 과정(CI/CD)에서 규칙을 따랐는지 보장할 때.
  • ✓여러분을 직접 신뢰하지 않고도 다른 사람이 에이전트의 작업을 검증해야 할 때.

스킬 링크

https://github.com/wshobson/agents/blob/main/plugins/signed-audit-trails/skills/signed-audit-trails-recipe/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/wshobson/agents/blob/main/plugins/signed-audit-trails/skills/signed-audit-trails-recipe/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“내 도구 호출에 대해 서명된 감사 추적을 설정해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 플러그인을 사용해 먼저 각 명령을 보안 정책(Cedar)과 대조하고, 그 결과에 대해 디지털 서명(Ed25519)을 만듭니다. 이 서명 덕분에 나중에 인터넷 연결이나 운영자를 신뢰하지 않고도 검증할 수 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Signed Audit Trails for Claude Code Tool Calls

Cookbook-style walkthrough for cryptographically signed receipts on every Claude Code tool call. This is the teaching skill. For the runtime implementation, install the protect-mcp plugin.

What this gives you

Every tool call (Bash, Edit, Write, WebFetch) is:

  1. Evaluated against a Cedar policy before execution. If the policy denies the call, the tool does not run.
  2. Signed as an Ed25519 receipt after execution. Receipts are JCS-canonical and verifiable offline by anyone with the public key.

An auditor, regulator, or counterparty can verify every receipt later (Step 5). No network call, no vendor lookup, no trust in the operator.

When to use the pattern

  • Regulated environments (finance, healthcare, critical infrastructure) where you need tamper-evident evidence of agent behavior
  • CI/CD pipelines where you want to prove that a policy gate held for every automated build step
  • Multi-party collaboration where a counterparty wants to verify your agent's behavior without trusting your operator
  • Compliance contexts (EU AI Act Article 12, SLSA provenance for agent-built software) where standard logging is not sufficient

Step 1: Install the hook configuration

Install the protect-mcp plugin with /plugin install protect-mcp. Its hooks run evaluate.sh before each tool call and sign.sh after it. Both scripts read the hook event from stdin, because Claude Code sets no TOOL_NAME or TOOL_INPUT variables. See references/hook-wiring.md for the hook configuration and what each script passes to protect-mcp.

protect-mcp 0.7.4 does not create the signing key, and without a key the receipts are unsigned. Create ./protect-mcp.key once. The command never replaces an existing key:

if [ ! -e ./protect-mcp.key ]; then
  d=$(mktemp -d) && npx protect-mcp@0.7.4 init --dir "$d" && mv "$d/keys/gateway.json" ./protect-mcp.key
fi

Give auditors the publicKey value from that file. Do not commit the file, because it also holds the private key.

Add the private key and receipt directory to .gitignore:

echo "/protect-mcp.key" >> .gitignore
echo "/receipts/" >> .gitignore

Step 2: Write a Cedar policy

Create ./protect.cedar from the example in references/cedar-policy.md. It allows read-only tools and a short list of Bash commands, denies shell chaining and destructive commands, and limits writes to the project with .. segments denied.

Step 3: Use Claude Code normally

Start Claude Code. Every tool call goes through both hooks:

You: Please read the README and summarize it.

Claude: I will read README.md.
  [PreToolUse: Read ./README.md -> allow]
  [Tool: Read executes]
  [PostToolUse: receipt rcpt-a8f3c9d2 signed to ./receipts/]

... summary of README ...

A session of 20 tool calls appends 20 receipts to ./receipts/receipts.jsonl.

Step 4: Inspect a receipt

protect-mcp 0.7.4 appends each receipt as one line of ./receipts/receipts.jsonl. Print the newest one:

tail -n 1 ./receipts/receipts.jsonl | python3 -m json.tool

The receipt is a signed v2 envelope that names the tool, and it holds no public key. See references/receipt-format.md for a sample and the signed fields.

Step 5: Verify the receipts

Pass the publicKey value from ./protect-mcp.key to the verifier:

PUB=$(node -p 'JSON.parse(require("fs").readFileSync("./protect-mcp.key")).publicKey')
npx @veritasacta/verify@0.9.2 --replay-chain ./receipts/receipts.jsonl --key "$PUB"

Exit codes:

Code Meaning
0 Every receipt verified
1 A receipt failed verification (tampered, wrong key, or malformed line)
2 The receipts file could not be read

Step 6: Demonstrate tamper detection

Change the newest receipt's decision from allow to deny:

python3 -c "
import json
path = './receipts/receipts.jsonl'
lines = open(path).read().splitlines()
r = json.loads(lines[-1])
r['payload']['decision'] = 'deny'
lines[-1] = json.dumps(r)
open(path, 'w').write('\n'.join(lines) + '\n')
"

npx @veritasacta/verify@0.9.2 --replay-chain ./receipts/receipts.jsonl --key "$PUB"

The verifier exits with code 1 and reports which line failed. The Ed25519 signature no longer matches the JCS-canonical bytes of the

…

자주 묻는 질문

서명된 감사 추적이란 무엇인가요?

작업에 대한 기록에 암호학적 서명을 한 것입니다. 만들어진 뒤 바뀌지 않았음을 보장하며, 공개 키를 가진 누구나 검증할 수 있습니다.

왜 Cedar를 쓰나요?

Cedar는 에이전트가 수행할 수 있는 작업을 통제하는 보안 규칙을 정의할 수 있게 하는 정책 언어입니다. 에이전트가 예상된 범위 안에서만 작동하도록 합니다.

사람들은 작업을 어떻게 검증하나요?

누구나 제공된 공개 키로 기록의 디지털 서명을 확인할 수 있습니다. 검증이 성공하면 그 기록이 진짜이며 변경되지 않았다는 뜻입니다.

상세 정보

작성자의 원본 설명

Step-by-step cookbook for setting up cryptographically signed audit trails on Claude Code tool calls. Use when explaining, evaluating, or demonstrating the pattern before committing to the protect-mcp runtime hooks. Covers Cedar policy, Ed25519 receipts, offline verification, tamper detection, CI/CD integration, and SLSA composition.

repo: wshobson/agents

인기도

GitHub 스타
41k
순위
#6787
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬