# spl-token-2022-security

> Token and Token-2022 extension risks, mint/freeze authority checks, and a listing/collateral risk screen.

spl-token-2022-security is a free AI agent skill on Agensi by BanditXBT, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [BanditXBT](https://www.agensi.io/creators/banditxbt)
- Category: [Security](https://www.agensi.io/skills/security)
- Uses: 2
- Version: 1.0
- Last updated: 2026-11-21
- Security: scan passed (2026-11-21); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/spl-token-2022-security
- Tags: web3-crypto, security, trading-investing

## About this skill

If your program accepts arbitrary mints, you are accepting arbitrary *behavior*. Allowlist, or code for the worst case.

Two token programs exist (legacy SPL Token and Token-2022). A token account/mint is owned by one of them. Never hardcode only the legacy program; accept the correct one by validating the mint's owner. In Anchor use `token_interface` (`InterfaceAccount<Mint>`, `InterfaceAccount<TokenAccount>`, `Interface<TokenInterface>`) and CPI through the *passed and validated* token program (use `transfer_checked`, which verifies mint and decimals).

| Extension | Risk |
|---|---|
| **Transfer fee** | Received amount < sent amount; accounting by `amount` overcredits. Compute net via the mint's fee config or measure balance delta. |
| **Transfer hook** | Arbitrary program runs on every transfer: extra required accounts, reentrancy-like behavior, compute use, and ability to block transfers (DoS/freeze-like). |
| **Permanent delegate** | A delegate can transfer/burn from *any* holder's account, including your vault. Reject for custody/collateral. |
| **Non-transferable** | Cannot move: deposits can't be withdrawn. |
| **Default account state / freeze** | New accounts may start frozen; issuer can freeze your vault. |
| **Mint close authority** | Mint can be closed (if supply 0) and re-created. |
| **Interest-bearing / scaled UI amount** | Displayed amount ≠ raw amount; use raw amounts for accounting, UI conversion only in clients. |
| **Confidential transfer** | Balances not visible on-chain; incompatible with most accounting. |
| **CPI guard, memo-required** | Transfers via CPI may be refused; memo required. |
| **Pausable / metadata / group pointers** | Pausable halts transfers; metadata is untrusted text. |

The extension set keeps growing (newer additions include scaled UI amounts and pausable mints): read the current Token-2022 docs for the live list instead of trusting this table as complete. Policy: maintain an **extension allowlist**; on `init`, read the mint's extension list and reject unsupported ones. Re-check where extensions can be changed post-hoc (authorities can add some extensions later: guard with authority checks).

## Requires

Nothing beyond your AI agent.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the spl-token-2022-security skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What does spl-token-2022-security do?

Token and Token-2022 extension risks, mint/freeze authority checks, and a listing/collateral risk screen.

### Which AI agents support spl-token-2022-security?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use spl-token-2022-security?

Connect your AI agent to Agensi through MCP, then ask it to use spl-token-2022-security on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
