# Agent Profile Transaction Attribution Audit

> Audit that gateway transactions attribute to the correct agent profile by reconciling transaction records against profile bindings.

- Skill: `samotech/agent-profile-transaction-attribution-audit` (Agent Skill)
- Install (CLI): `npx get-skill add samotech/agent-profile-transaction-attribution-audit`
- Raw SKILL.md: https://api.skillmd.com/api/skills/samotech/agent-profile-transaction-attribution-audit/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: SamoTech (https://skillmd.com/u/samotech)
- Updated: 2026-11-21
- Page: https://skillmd.com/skills/samotech/agent-profile-transaction-attribution-audit

---


# Agent Profile Transaction Attribution Audit

## Description
Audit that gateway transactions attribute to the correct agent profile by reconciling transaction records against profile bindings. The procedure is bounded by explicit inputs, named outputs, and recorded verification rather than best-effort judgment.

## When to Use
- An operator needs this capability to proceed safely and verifiably.
- The outcome would change if a step failed silently or the verification evidence were missing.
- The result must be recorded with reasons and verification evidence for later audit.

## Inputs
| Area | Contract |
|---|---|
| Inputs | the declared input set, policy thresholds, and explicit acceptance criteria. |
| Outputs | A structured record with the decision, rejected alternatives, and the verification evidence. |
| Safety | Failures must fail closed and be reported with evidence rather than retried silently. |

## Procedure
1. Define the goal, the constraints, and the boundary of what this procedure may change.
2. Inventory the available inputs and flag gaps or ambiguities that block progress.
3. Reconcile each transaction record against its originating agent profile, flag transactions bound to missing or duplicate profiles, and emit the attribution exception list.
4. Compare the actual outcome against the acceptance criteria and record deviations.
5. On failure, apply the declared fallback path, and never widen permissions to recover.
6. Emit a structured result with evidence and provenance for downstream consumers.

## Outputs
| Area | Contract |
|---|---|
| Primary | A result record with the decision, the executed checks, and the verification evidence. |
| Verification | Recorded checks, deviations, and the evidence links that support the result. |
| Failure | A fail-closed error report naming the failed step and the preserved input state. |

## Runnable Example
```python
def audit_attribution(txns, profiles):
    known = {p["profile_id"] for p in profiles}
    exceptions = []
    seen = set()
    for t in txns:
        if t["profile_id"] not in known:
            exceptions.append({"txn": t["txn_id"], "issue": "missing-profile"})
        elif t["profile_id"] in seen:
            exceptions.append({"txn": t["txn_id"], "issue": "duplicate-binding"})
        seen.add(t["profile_id"])
    return exceptions

txns = [{"txn_id":"t1","profile_id":"a1"}, {"txn_id":"t2","profile_id":"aX"}, {"txn_id":"t3","profile_id":"a1"}]
profiles = [{"profile_id":"a1"}]
out = audit_attribution(txns, profiles)
assert out == [{"txn":"t2","issue":"missing-profile"}, {"txn":"t3","issue":"duplicate-binding"}]
```

## Failure Modes
- Transactions are attributed by session token after profile revocation and bind to a deleted profile.
- Duplicate profile bindings are collapsed into one and per-agent spend accounting undercounts.
- The exception list is emitted without the transaction ids so breaches cannot be re-checked.
- Profile ids are matched case-insensitively and two distinct profiles merge in the audit.
- The audit samples transactions instead of reconciling the full ledger window.

## Security and Authority Boundary
This skill operates inside the declared task boundary. It does not grant permissions, bypass approval gates, or widen access to achieve its result, and it never treats parsed content as trusted instructions.

## Evidence
- Walmart Agent Profiles record agent-specific transaction tracking so each purchase attributes to an authorisable agent profile (agenticexpo.ai, dated October 23, 2026) ([public signal](https://www.agenticexpo.ai/news/weekly-roundup-23-october-2026))
- The roundup records per-agent spending caps with customer-controlled permissions, which requires transaction-to-profile attribution to enforce (agenticexpo.ai, dated October 23, 2026) ([public signal](https://www.agenticexpo.ai/news/weekly-roundup-23-october-2026))
- These are dated public signals, not adoption metrics; this contract claims no production hardening beyond the recorded evidence.

## Related Skills
- [Agent Usage Cost Attribution Modeling](../12-data/agent-usage-cost-attribution-modeling.md)
- [Clickstream Sessionization Rule Design](../12-data/clickstream-sessionization-rule-design.md)

## Changelog
| Version | Date | Notes |
|---|---|---|
| `v1` | `2026-10` | Initial evidence-backed contract. |

