AgentSIM.exe — a new use for your SIM
OLD TECH. NEW ERA.

SIM signing
for AI agents.

AgentSIM explores using compatible SIM cards to sign an agent’s permissions. A small Java Card applet lets a compatible SIM sign messages with P‑256.

SIM SIGNING · NEAR SANDBOX · TEST FUNDS

AUTHORITY LINK OWNER → AGENT
AGENTSIM™
OWNER AUTHORITY
STAYS WITH YOU.01 / 98
● P‑256 OWNER KEY
≠ AGENT SESSION KEY
● WORKING SANDBOX DEMOJAVA CARD / P‑256EST. 2026
01 / HOW IT WORKS

How agent
permissions work.

A Java Card applet signs the owner’s permission with P‑256. The agent runs separately and signs requests with Ed25519. A Rust vault enforces the signed limits on a private NEAR sandbox.

AUTHORIZATION BUS ILLUSTRATED SANDBOX FLOW
01OWNERReview & sign
02GRANTSupplier · cap · expiry
03AGENTSign a request
04NEAR VAULTEnforce the budget
P‑256 → owner permissionEd25519 → agent requests
The vault checks each signed payment against the owner’s grant.
01 / APPROVE

Set spending limits

Approve one recipient, a per-call cap, a lifetime budget, an agent key and an expiry. The signature also binds the grant to its chain, vault and owner epoch.

02 / DELEGATE

Owner and agent keys

The PC/SC host checks the pinned owner key, asks for the PIN and verifies the returned P‑256 signature. The same product applet can run in jCardSim for reproduction. The agent keeps a separate Ed25519 key.

03 / ENFORCE

Verify each request

The Rust vault checks signatures, recipient, nonce, expiry and budget before reserving funds. A restricted relayer key can call only this vault’s execute method, with zero attached deposit.

04 / REVOKE

Revoke access

The owner can revoke a grant or pause the vault. Already accepted transfers may remain in flight; revocation cannot undo them.

02 / SIM REQUIREMENTS
COMPATIBILITY MAP CARD PROVISIONING
Suitable card + provisioning permission + trusted approval

SIM support
and requirements.

A physical SIM signing path is implemented through PC/SC. Using it on a phone still requires a compatible card, authorized applet installation and a handset screen where the owner can review the recipient and budget.

COMPATIBLE SIM→INSTALL APPLET→USE

Not every SIM supports P‑256 or allows applet installation. The handset approval screen and authorized provisioning are not shipped. PC/SC provides transport, not device attestation.

8.8bn

wireless connections

5.8bn

unique mobile subscribers

Mobile ecosystem figures cited in the current project README. They do not count AgentSIM-compatible devices.
Source: GSMA Mobile Economy 2026 ↗
03 / IMPLEMENTATION & RESULTS

SIM signatures
and NEAR payments.

The Rust vault was built and executed on agentsim-local, a private NEAR sandbox. Two recorded NEAR AI proposals each led to a transfer of 0.001 test NEAR and a successful settlement callback.

The November 15 capture records physical SIM signing over PC/SC; the November 14 run is the emulator control. Both keep the owner’s P‑256 key separate from the agent and relayer keys.

BUILT & SANDBOX-TESTED

Rust NEAR vault

The checked-in WASM matches the deployed-code hash in the records. The verified flow covers signed authorization, agent spending, the transfer receipt, callback and revocation.

Built WASM ↗ · Contract source ↗
RECORDED PC/SC CAPTURE

SIM owner signer

The November 15 record includes the applet AID, pinned P‑256 public key, PC/SC transport and verified grant and revocation signatures. jCardSim is the separate reproduction path.

PC/SC host ↗ · Java Card applet ↗
CHECKED 15 NOVEMBER 2026

Tests and proof checks

All 48 core tests passed in the reviewed revision. Both recorded NEAR AI payments and the local sandbox transfer passed their offline verifiers. The records include four relay-permission denials, overspending rejection and rejection after revocation.

Run the checks →

Recorded payment runs

14 NOVEMBER · 21:22 UTC

Emulator control

0.001 test NEAR settled
NEAR AI proposal, jCardSim owner signer, Rust vault and successful callback.

5K5Uz1Evew8wNKsYyKQjj7wTDtgnmWzWbzu8U11mnmJzOpen the payment record ↗
15 NOVEMBER · 00:06 UTC

PC/SC signing capture

0.001 test NEAR settled
NEAR AI proposal, recorded physical SIM owner signer, Rust vault and successful callback.

uZ5xPztcDMj2MYpwgXjzPQxQH2WhuupFA2vUxw1qUgqOpen the payment record ↗

Scope: private local NEAR execution with test funds. No public-chain payment or compute delivery. The proof checks signed messages, transactions, recorded receipts and final policy states; it does not independently attest the card or AI provider.

PAYMENT TRACE ILLUSTRATED RECORDED FLOW
01 OWNER GRANT P‑256 SIGNED
02 AGENT REQUEST Ed25519 SIGNED
03 RUST NEAR VAULT LIMITS CHECKED
04 LOCAL TRANSFER CALLBACK SUCCESS
05 OVERSPEND / REVOKED REJECTED
Local NEAR transfers use test funds.
04 / SPENDING DEMO

Try the agent’s
spending limits.

A research agent needs compute. You approve the supplier and limit its allowance. Try a valid spend, then try breaking the rules. This browser illustration uses pretend credits and performs no signing or payment. The recorded Rust-vault run uses local NEAR test funds.

PER PURCHASE 100 creditsTOTAL 150 creditsSUPPLIER compute.local
▣   permission_control.exe
PERMISSION STATUS● ACTIVE
REMAINING150 CR
> Ready. Choose an action below.

ILLUSTRATION ONLY · NO SIGNING · NO REAL FUNDS

05 / SECURITY

Security risks
and limitations.

A signature proves control of a key. It does not prove the device is a SIM, establish legal identity, or guarantee that purchased compute was delivered.

Stolen agent key

The remaining grant allowance is at risk. The owner’s unrestricted authority stays separate.

Untrusted relay

A relay can delay or censor requests. Signed bytes prevent it from silently changing the authorization.

Misleading approval

The owner needs a trusted view of exact amounts and recipients. A SIM usually has no trusted display.

Contract & admin risk

Contract bugs and deployment keys can defeat application controls. Production needs an explicit upgrade and recovery policy.

The signed grant carries public keys and spending rules; no phone number, IMSI, ICCID, passport or raw identity credential is needed. Public account links and timing can still be sensitive. The operator keeps contract administration authority, and the prototype is not audited for production.

Security and verification limits ↗ · Security policy ↗
06 / CODE AND SETUP

Run the demo.
Browse the code.

Run these commands from the root of the linked public repository with Node.js 22 or later. The proof verifier reads the recorded evidence; it does not start a chain or send a payment.

C:\AGENTSIM> quick_start.txt
# Software spending example
npm run demo

# Core tests and recorded payment proof
npm ci --prefix tests/near-sandbox
npm test
npm run verify:proof

# Optional: applet tests with JDK 17+
npm run card-sim:setup
npm run card-sim:test

Expected: 48 core tests pass, followed by the verifier’s “Verified restricted key setup…” message. Recorded-proof verification needs no card or JDK. Applet setup downloads a pinned, hash-checked jCardSim dependency.

Verify both recorded NEAR AI payments
node tests/near-sandbox/verify-restricted.mjs evidence/near/2026-11-14-live-near-ai.json
node tests/near-sandbox/verify-restricted.mjs evidence/near/2026-11-15-live-near-ai.json

The checks reconstruct signed actions, verify owner and agent signatures, compare WASM hashes and assert the recorded settlement and policy results. They verify stored evidence without rerunning the sandbox.

Run a new sandbox payment

Follow the restricted relayer guide ↗ for the dedicated loopback-only sandbox and explicit simulator or PC/SC signer selection. A new run needs the sandbox and signer setup. Live AI mode additionally needs a privately configured NEAR AI credential. This is separate from verifying the supplied records.

Windows dependency setup

If local package links are restricted, install the proof dependencies with:

npm ci --prefix tests/near-sandbox --install-links --bin-links=false

The core tests and recorded-proof verifiers were checked from a separate copy of the public revision on this platform.

Next steps

  1. Phone approval: show the exact recipient, amount, budget and expiry on a handset before signing.
  2. Provisioning: validate supported SIMs and authorized applet installation for a phone deployment.
  3. Public network: deploy and verify receipts on a public NEAR testnet. The supplied payment records are local sandbox runs.
  4. Production review: audit the contract, administration policy, recovery and settlement edge cases before putting real funds at risk.
ABOUT / AGENTSIM

About AgentSIM
and its creator.

AgentSIM combines a PIN-gated Java Card owner signer, separate Ed25519 agent keys and a Rust vault tested on a private NEAR sandbox. The public repository includes PC/SC transport, emulator tests, recorded NEAR AI proposals and verifiable local payment receipts.

View source on GitHub ↗

github.com/Lem0nTree/agentsim-nearhackathon · MIT license

Built by Lemon Tree @Lem0nTree ↗

A winemaker and Web3 developer who works on DeFiBuilder and explores AI, hardware and firmware. Past projects include NearYield, which won first prize at NEARCON 2023.

EXTRAS.98One more thing on this disk…

Some ideas start with a terminal.
Some start with a little curiosity.

JAVA CARD · P‑256 · Ed25519 · NEAR
Done.Local prototype · 2026
▣   AgentSIM.exe
◖))