Developers

AI Agents & LLMs

Discover verified asset pairs via llms.txt and OpenAI manifests, and execute MEV-resistant confidential DeFi operations.

ShadowLine is built from the ground up for autonomous AI agents, LLMs, and programmatic wallets. Discover verified asset pairs via standard AI manifests and execute MEV-resistant confidential DeFi operations.

Why Autonomous AI Agents Need ShadowLine

AI agents executing on-chain trading strategies, DAO treasury management, or automated payroll face critical vulnerabilities when holding public ERC-20 tokens:

  • MEV Exploitation & Sandwiche Attacks: Searchers monitor public mempools and agent balances to front-run automated trades.
  • Strategy Copy-Trading:Observers can copy or counter-trade an AI agent's portfolio rebalancing in real time.
  • Treasury Exposure: DAO and agent operational wallets reveal sensitive cash flow and runway data.

By wrapping public tokens into ERC-7984 confidential wrappers (cTokens) on Zama's fhEVM, AI agents hold encrypted balances (euint64) and execute confidential transfers completely hidden from public scrutiny.

1. llms.txt — AI Discovery Standard

ShadowLine adheres to the emerging llmstxt.org specification. LLMs and autonomous coding agents can read our structured summaries directly:

  • /llms.txt — High-level protocol summary, capabilities, and core concepts.
  • /llms-full.txt — Complete developer reference including smart contract ABIs, Viem code patterns, and decimal scaling rules.

2. OpenAI & Universal AI Plugin Manifests

ShadowLine hosts standard discovery manifests, allowing AI frameworks (ChatGPT plugins, LangChain, Vercel AI SDK, Eliza) to auto-discover our REST API and query confidential asset pairs without manual schema configuration:

  • /.well-known/ai-plugin.json — Plugin metadata and authentication spec.
  • /openapi.json — OpenAPI 3.0 specification for the /api/registry endpoint.

3. Agent Tools SDK (`@shadowline/agent-tools`)

For developers building AI agents with TypeScript, we provide pre-built tool definitions in src/lib/agent-tools.ts. These tools can be plugged directly into LangChain or Vercel AI SDK:

typescript
import { shadowlineTools } from '@/lib/agent-tools';
import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';

// Equip your agent with native understanding of ShadowLine FHE assets!
const response = await generateText({
  model: openai('gpt-4o'),
  tools: shadowlineTools,
  prompt: 'Check Sepolia for available confidential token pairs and tell me the decimal rule for shielding USDC.',
});

4. Headless Execution Harness (`ShadowlineAgentHarness`)

To enable autonomous AI agents to execute real FHE asset shielding, confidential transfers, and balance decryption in a backend or script environment (without a web browser), use the headless execution harness in src/lib/agent-harness.ts:

typescript
import { ShadowlineAgentHarness } from '@/lib/agent-harness';

// 1. Initialize Headless Agent Harness (Node.js worker pool mode)
const agent = new ShadowlineAgentHarness({
  privateKey: process.env.AGENT_PRIVATE_KEY as `0x${string}`,
  relayerApiKey: process.env.ZAMA_RELAYER_API_KEY || 'YOUR_API_KEY',
});
await agent.init();

// 2. Discover pairs and execute confidential DeFi actions
const pairs = await agent.getPairs();
const usdcWrapper = pairs.find(p => p.symbol === 'USDC')?.confidentialTokenAddress || pairs[0].confidentialTokenAddress;

// Shield (wrap) public USDC into confidential cUSDC
const shieldHash = await agent.shield(usdcWrapper, '10.0');

// Decrypt balance via EIP-712 permit & WASM decryption
const balance = await agent.getConfidentialBalance(usdcWrapper);

// Send confidential cUSDC (client-side WASM encryption + FHE input proof)
const transferHash = await agent.transfer(usdcWrapper, '0xRecipient', '5.0');
Critical Rule for AI Agents: When shielding (depositing), input amounts MUST use the underlying token's decimals (e.g. 6 for USDC, 18 for WETH). When unshielding (withdrawing) or transferring, amounts MUST always use the wrapper's fixed euint64 6-decimal scale.