verify

bởi anthropic

Xác minh các thay đổi của harness từ đầu đến cuối mà không cần docker — điều khiển CLI thực tế đã được ghim chống lại máy chủ stub thu thập header với env resolve_auth_env() chính xác…

npx skills add https://github.com/anthropics/defending-code-reference-harness --skill verify

Verifying harness changes on a docker-less host

The pipeline's real surface is the in-container claude -p process and its outbound API requests. Without docker, drive the same pinned CLI binary directly with the env dict the harness would inject via docker -e.

Recipe

  1. Get the pinned CLI (version from harness/agent_image.py:CLAUDE_CODE_VERSION): npm install --no-save @anthropic-ai/claude-code@<pin> in a temp dir → binary at node_modules/@anthropic-ai/claude-code/bin/claude.exe (the .exe name is the real native-binary entry on Linux too, filled in by the package's postinstall — not a Windows leftover).
  2. Stub API server: a tiny HTTP server that appends each request's headers to a JSONL file and returns a 400 invalid_request_error (non-retryable, so the CLI exits fast; exit=1 is expected).
  3. Build the agent env exactly as the pipeline does: python3 -c "from harness.auth import resolve_auth_env; ..." and dump to an export-lines file with shlex.quote (values contain newlines — NEVER pass via env $(...), word-splitting mangles them; source the file).
  4. Emulate the container env: unset ANTHROPIC_CUSTOM_HEADERS (and any other ambient var not in the resolved dict) before sourcing — a Claude Code session in this repo injects .claude/settings.json env into shells, which containers never see.
  5. Run: ANTHROPIC_BASE_URL=http://127.0.0.1:<port> CLAUDECODE= IS_SANDBOX=1 timeout 30 <cli> -p hi --model claude-sonnet-4-5 --max-turns 1, then read the captured JSONL.

Gotchas

  • Unit tests in tests/test_patch.py / tests/test_patch_grade.py need docker and fail on docker-less hosts — pre-existing, not your change.
  • The docker -e injection leg itself can't be exercised without docker; it's the same mechanism that carries ANTHROPIC_API_KEY in production.
  • For the interactive-skills surface, copy .claude/settings.json into a fresh temp dir and run the host claude from there (with ambient ANTHROPIC_CUSTOM_HEADERS unset so settings.json is the only source).

Thêm skills từ anthropic

access
anthropic
Quản lý quyền truy cập kênh Discord — phê duyệt ghép cặp, chỉnh sửa danh sách cho phép, đặt chính sách DM/nhóm. Sử dụng khi người dùng yêu cầu ghép cặp, phê duyệt ai đó, kiểm tra ai được phép,…
official
session-report
anthropic
Tạo báo cáo HTML có thể khám phá về việc sử dụng phiên Claude Code (token, bộ nhớ đệm, tác nhân phụ, kỹ năng, lời nhắc tốn kém) từ bản ghi ~/.claude/projects.
official
build-mcp-server
anthropic
Kỹ năng này nên được sử dụng khi người dùng yêu cầu "xây dựng một máy chủ MCP", "tạo một MCP", "tạo tích hợp MCP", "bọc một API cho Claude", "cung cấp công cụ cho…
official
cookbook-audit
anthropic
Kiểm tra một notebook trong Anthropic Cookbook dựa trên tiêu chí đánh giá. Sử dụng khi có yêu cầu xem xét hoặc kiểm tra notebook.
official
handle-complaint
anthropic
Xử lý khiếu nại của khách hàng từ đầu đến cuối — lấy ngữ cảnh, soạn phản hồi và đề xuất giải pháp vận hành. Chấp nhận email hoặc ID ticket tùy chọn…
official
use-case-triage
anthropic
Nhanh chóng xác định xem một hoạt động xử lý có cần PIA, DPIA bắt buộc theo GDPR hay có thể tiến hành — phát hiện xung đột chính sách quyền riêng tư và định tuyến đến đúng…
official
board-minutes
anthropic
Soạn thảo biên bản cuộc họp hội đồng hoặc ủy ban theo định dạng của bạn. Tự động phát hiện các cuộc họp hội đồng và ủy ban sắp tới từ lịch của bạn, yêu cầu chương trình họp và…
official
renewal-tracker
anthropic
Hiển thị các hợp đồng có thời hạn hủy sắp đến và cảnh báo trước khi cửa sổ thông báo đóng, làm việc từ sổ đăng ký gia hạn được duy trì. Sử dụng khi người dùng yêu cầu…
official