Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

axiom-app-attestAxiom 应用程序证明

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

875

周安装

34

GitHub Stars

873

下载量

280
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:axiom-app-attest(Axiom 应用程序证明)
来源仓库:https://github.com/charleswiltgen/axiom
仓库路径:skills/axiom-app-attest
安装命令:
npx skills add https://github.com/charleswiltgen/axiom --skill axiom-app-attest
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/charleswiltgen/axiom --skill axiom-app-attest

简介

实现设备绑定的应用完整性验证,防止欺诈行为。

  • 证明请求来自真实苹果设备且 payload 未被篡改。
  • 适用于购买验证、促销防滥用和服务器端 attestation 处理。
  • 安装命令:npx skills add https://github.com/charleswiltgen/axiom --skill axiom-app-attest
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

App Attest

Device-backed app integrity verification for fraud prevention. Proves three things to your server: the request came from a genuine Apple device, running your genuine app, with an untampered payload.

When to Use This Skill

Use when you need to:

  • Verify requests come from legitimate app instances (not modified/cloned apps)
  • Prevent fraud in purchases, promotions, or competitive features
  • Implement DCAppAttestService attestation or assertion flows
  • Handle DeviceCheck 2-bit per-device state for promotional abuse
  • Build server-side validation for attestation objects or assertion signatures
  • Plan a gradual App Attest rollout for a large install base

Example Prompts

"How do I verify my app hasn't been tampered with?" "DCAppAttestService attestKey keeps failing with serverUnavailable" "How do I prevent users from claiming a free trial multiple times?" "What's the difference between attestation and assertion?" "How do I validate an attestation object on my server?" "isSupported returns false — should I block the user?" "We have 2M DAU, how do I roll out App Attest safely?" "How do I detect if someone is creating fake app instances?"

Red Flags

Signs you're headed for trouble:

  • Validating app integrity on-device — Modified apps control the runtime. Any local check can be patched out. Verification MUST happen server-side.
  • Not guarding with isSupported — DCAppAttestService crashes on unsupported devices. Always check before calling any API.
  • Blocking users when isSupported returns false — Some legitimate devices return false. Treat as risk signal, not hard block.
  • Reusing keys across multiple users on same device — One key per user per device. Shared keys break account-level trust association.
  • Enabling App Attest for all users at onceattestKey calls Apple's servers. At scale, rate limiting causes failures. Gradual rollout required (WWDC 2021-10244).
  • Using assertions for every API call — Cryptographic cost per call. Reserve for sensitive operations (purchases, account changes), not routine fetches.
  • Discarding key on serverUnavailable error — Transient Apple server issue. Retry with same key. Only discard on other errors.
  • Skipping counter validation on server — Counter must be ever-increasing. Without this, replay attacks succeed.

Three Properties Verified

App Attest proves three things about each request:

PropertyWhat It ProvesHow
Genuine deviceRequest comes from real Apple hardwareHardware-backed key in Secure Enclave
Genuine appYour app binary, unmodifiedApp identity hash in attestation
Untampered payloadRequest data hasn't been alteredDigest signing in assertions

Privacy design: Anonymous. No hardware identifiers. Keys don't survive reinstall/migration/restore. Apple can't correlate across apps or users.

Key Generation

import DeviceCheck

func generateAppAttestKey(for userId: String) async throws -> String {
    let service = DCAppAttestService.shared

    guard service.isSupported else {
        // NOT an error — use as risk signal, not blocker
        reportUnattestedDevice()
        throw AppAttestError.unsupported
    }

    let keyId = try await service.generateKey()
    // Cache persistently — one key per user per device
    UserDefaults.standard.set(keyId, forKey: "appAttestKeyId_\(userId)")
    return keyId
}

Key lifecycle: One key per user per device. Cache keyId persistently (Keychain or UserDefaults). Keys don't survive reinstall, migration, or restore. App Clips share identity with full app. Generate new key on sign-out.

Attestation Flow

Attestation registers the key with Apple and your server. Happens once per key.

digraph attestation {
    "Server issues\nchallenge" [shape=ellipse];
    "SHA256 hash\nchallenge" [shape=box];
    "attestKey API\n(Apple servers)" [shape=box];
    "Send attestation\nto your server" [shape=box];
    "Server validates\ncertificate chain" [shape=box];
    "Store public key\n+ key association" [shape=doublecircle];

    "Error?" [shape=diamond];
    "serverUnavailable?" [shape=diamond];
    "Retry same key" [shape=box];
    "Discard key\ngenerate new" [shape=box];

    "Server issues\nchallenge" -> "SHA256 hash\nchallenge";
    "SHA256 hash\nchallenge" -> "attestKey API\n(Apple servers)";
    "attestKey API\n(Apple servers)" -> "Error?" ;
    "Error?" -> "Send attestation\nto your server" [label="success"];
    "Error?" -> "serverUnavailable?" [label="error"];
    "serverUnavailable?" -> "Retry same key" [label="yes"];
    "serverUnavailable?" -> "Discard key\ngenerate new" [label="no"];
    "Send attestation\nto your server" -> "Server validates\ncertificate chain";
    "Server validates\ncertificate chain" -> "Store public key\n+ key association";
}
func attestKey(userId: String) async throws {
    guard let keyId = storedKeyId(for: userId) else {
        throw AppAttestError.noKey
    }

    // 1. Get one-time challenge from YOUR server (minimum 16 bytes)
    let challenge = try await server.fetchAttestationChallenge()

    // 2. Hash the challenge
    let hash = Data(SHA256.hash(data: challenge))

    // 3. Request attestation from Apple
    do {
        let attestation = try await service.attestKey(keyId, clientDataHash: hash)
        // 4. Send attestation object to YOUR server for validation
        try await server.verifyAttestation(attestation, keyId: keyId, challenge: challenge)
    } catch DCError.serverUnavailable {
        // Transient — retry with SAME key later
        scheduleAttestationRetry(keyId: keyId, userId: userId)
    } catch {
        // Other error — key is compromised or invalid
        // Discard and generate a new key
        clearStoredKey(for: userId)
        try await generateAndAttestNewKey(userId: userId)
    }
}

Challenge requirements: Server-generated, single-use, minimum 16 bytes, short-lived (expire after minutes, not hours).

Assertion Flow

Assertions prove ongoing request integrity. No Apple server involvement — on-device only.

func assertRequest(payload: Data, userId: String) async throws -> Data {
    guard let keyId = storedKeyId(for: userId) else {
        throw AppAttestError.noKey
    }

    // Hash the payload you want to protect
    let hash = Data(SHA256.hash(data: payload))

    // Generate assertion (on-device, no network)
    let assertion = try await service.generateAssertion(keyId, clientDataHash: hash)

    // Send assertion + original payload to server
    // Server verifies signature and checks counter
    return assertion
}

When to assert: Reserve for moments that cost you money or trust if faked.

AssertDon't Assert
In-app purchasesContent fetches
Account changes (email, password)Read-only API calls
Competitive actions (leaderboard scores)Analytics events
Promotional claims (free trial)UI configuration
Reward redemptionsSearch queries

Performance: Secure Enclave operations. Fast enough for individual actions, expensive on every request.

Server-Side Validation

Your server does the actual trust verification. The app only generates cryptographic material.

Attestation Validation (once per key)

  1. Certificate chain — Verify roots to Apple's App Attest root CA (Apple Private PKI)
  2. Nonce — Recompute SHA256(challenge || clientDataHash), match against credential certificate
  3. App identity hash — SHA256(teamId + "." + bundleId) must match your app
  4. Counter — Store initial value (assertions increment from here)
  5. Key association — Extract and store public key, associate with user account

Assertion Validation (per sensitive request)

  1. Signature — Verify using stored public key from attestation
  2. App identity hash — Must match attestation's hash (prevents cross-app replay)
  3. Counter — Must be strictly greater than last seen value (replay protection)
  4. Client data hash — Recompute from request payload, must match what was signed

Counter is critical: Without strictly-increasing counter validation, replay attacks succeed indefinitely.

Rollout Strategy

From WWDC 2021-10244: attestKey makes a network call to Apple's servers. Apple rate-limits these calls per app.

Install BaseRecommended Ramp Time
<100K DAUDays
~1M DAU~1 day gradual ramp
~100M DAUWeeks
~1B DAU1+ month gradual ramp

Gradual Enablement Pattern

func shouldEnableAppAttest(userId: String) -> Bool {
    guard DCAppAttestService.shared.isSupported else { return false }
    // Server controls rollout percentage — start at 1%, ramp daily
    return server.isAppAttestEnabled(for: userId)
}

Rollout process: Start at 1%. Monitor attestation success rate. If above 95%, double daily. If rate limiting errors spike, pause. Treat unattested requests as lower-trust during rollout (additional fraud signals), not blocked.

DeviceCheck Integration

DeviceCheck stores 2 bits of state per device on Apple's servers. Different purpose from App Attest.

FeatureApp AttestDeviceCheck
PurposeVerify app integrityTrack per-device state
Survives reinstallNoYes (tied to hardware)
Apple serversAttestation onlyEvery query

Promotional Fraud Prevention

import DeviceCheck

func checkTrialEligibility() async throws -> Bool {
    guard DCDevice.current.isSupported else { return true }

    let token = try await DCDevice.current.generateToken()
    // Server calls Apple: POST https://api.devicecheck.apple.com/v1/query_two_bits
    let state = try await server.queryDeviceState(token: token)
    return !state.bit0  // bit0 = has claimed trial
}

func markTrialClaimed() async throws {
    let token = try await DCDevice.current.generateToken()
    // Server calls Apple: POST https://api.devicecheck.apple.com/v1/update_two_bits
    try await server.updateDeviceState(token: token, bit0: true)
}

2 bits, your rules: Apple stores bits + timestamp. Semantics are yours (e.g., bit0=trial claimed, bit1=abuse flagged). Reset on your schedule. Shared across all apps from the same developer team — coordinate meaning across your portfolio.

Risk Metric Service

After attestation, redeem the receipt with Apple to get risk metrics:

Server-side: POST receipt to https://data.appattest.apple.com/v1/attestationData (use data-development.appattest.apple.com for sandbox). Response includes approximate key count for the device.

How to use: Most devices have 1-3 keys. High key counts signal an attacker creating many fake identities. Redeem periodically (Apple rate-limits), establish a baseline for your app, and combine with other fraud signals (velocity, behavioral analysis).

Anti-Rationalization Table

RationalizationWhy It FailsWhat To Do Instead
"We'll validate integrity on-device"Modified apps control the runtime and can patch out any local checkAll validation on your server. Device only generates crypto material.
"isSupported is always true on modern devices"Some configurations and enterprise MDM setups return falseAlways guard. Handle false as risk signal, not crash.
"One key per device is enough"Multi-user devices need per-user keys for accurate account associationOne key per user per device. New key on sign-out.
"We'll enable App Attest for everyone on launch day"Apple rate-limits attestKey calls. Large install bases will see widespread failures.Server-controlled gradual rollout. Monitor success rate.
"Assert every API call for maximum security"Secure Enclave operations have real cost. Assertion latency on every request degrades UX.Assert sensitive operations only. Use session tokens for routine calls.
"serverUnavailable means the key is bad"It's a transient Apple server issue. Discarding the key forces re-attestation unnecessarily.Retry with same key. Only discard on non-transient errors.
"We don't need counter validation"Without strictly-increasing counters, replay attacks succeed indefinitely.Store counter server-side. Reject assertions with counter <= last seen.
"DeviceCheck replaces App Attest"DeviceCheck is 2-bit state storage, not integrity verification. Different threat models.Use both: App Attest for integrity, DeviceCheck for per-device flags.

Pressure Scenarios

Scenario 1: "Block users who fail attestation"

Pressure: "If they can't attest, they're probably running a modified app. Block them."

Reality: isSupported returns false on legitimate devices (older hardware, enterprise MDM, simulator). During rollout, most users simply haven't been enrolled yet. Blocking = blocking real customers.

Correct action: Trust tiers on server. Attested = high trust. Unattested = lower trust with additional fraud signals. Never hard-block on attestation failure alone.

Push-back template: "Some legitimate devices return isSupported=false. Let's use attestation as one signal in a risk score — high trust for attested, additional checks for unattested."

Scenario 2: "Enable App Attest for everyone at once"

Pressure: "We've been building this for weeks. Ship it to everyone."

Reality: attestKey calls Apple's servers. Apple rate-limits per app. At 5M DAU, flipping the switch causes a thundering herd — mass failures, error floods, confused users. WWDC 2021-10244 explicitly recommends gradual rollout.

Correct action: Server-controlled rollout starting at 1%. At 5M DAU, expect ~1 week to full rollout.

Push-back template: "Apple rate-limits attestKey calls — their WWDC session recommends gradual rollout. I'll set up server-side percentage control starting at 1%, ramping to 100% over about a week."

Checklist

Before shipping App Attest:

Key Generation:

  • isSupported checked before any DCAppAttestService call
  • Graceful handling when isSupported returns false (risk signal, not block)
  • Key ID cached persistently per user
  • One key per user per device (not shared)

Attestation:

  • Challenge from server is single-use, minimum 16 bytes, short-lived
  • serverUnavailable retries with same key
  • Other errors discard key and generate new
  • Attestation object sent to server for validation (not validated on-device)

Assertion:

  • Used only for sensitive operations (not every API call)
  • Payload hash covers the actual request data being protected
  • Server validates signature with stored public key
  • Server validates counter is strictly increasing

Server:

  • Certificate chain validated against Apple's App Attest root CA
  • App identity hash (teamId + bundleId) verified
  • Counter stored and checked for strict increase
  • Public key associated with user account

Rollout:

  • Server-controlled percentage (not client-side)
  • Gradual ramp with monitoring
  • Unattested users handled gracefully (lower trust, not blocked)
  • Rollback plan if attestation success rate drops

Resources

WWDC: 2021-10244

Docs: /devicecheck, /devicecheck/establishing-your-app-s-integrity, /devicecheck/validating-apps-that-connect-to-your-server

Skills: axiom-cryptokit

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.05%
按下载量换算104

Claude

31.04%
按下载量换算87

Cursor

18.6%
按下载量换算52

Gemini CLI

9.03%
按下载量换算25

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills