We've enhanced security by integrating AI-powered transaction simulation and risk analysis directly into the approval queue, giving users a clear, human-readable summary before they sign.
> impact
We have shipped a new security layer for the transaction approval process in `pi-one`. Before a transaction is queued for user signing via their KMS, it is now intercepted and processed by a specialized LLM service. This service simulates the transaction's outcome, decodes its calldata, and generates a plain-language summary of its effects, including any state changes and function calls involved.
Previously, users were presented with raw or partially decoded transaction data in the approval queue. This made it incredibly difficult to spot sophisticated phishing attempts or understand the full implications of a transaction, such as a malicious contract granting unlimited token approvals. Relying on manual user verification for complex on-chain interactions was a significant security vulnerability that needed to be addressed.
This integration transforms the user experience from one of blind trust to informed consent. By presenting a clear, AI-generated risk analysis (e.g., 'Warning: This transaction grants unlimited approval for your USDC to a newly deployed contract'), we empower users to confidently approve or reject transactions. This drastically reduces the risk of falling victim to scams and strengthens the overall security posture of any application built on `pi-one`.
> Try this now
try this
# Create a potentially risky transaction, like a blank-check approval for USDC.
# This is a common pattern in phishing attacks.
const transaction = {
to: '0xUSDC_CONTRACT_ADDRESS',
data: '0x095ea7b3000000000000000000000000MALICIOUS_CONTRACT_ADDRESSffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', // approve(address, uint256.max)
value: '0'
};
# Instead of directly queuing the raw transaction for signing,
# pass it through the new AI analysis pipeline.
# The system will simulate the transaction and generate a security report.
const { analysis, transactionObject } = await piOne.analyzeAndQueueForApproval(transaction);
# The returned `analysis` object contains the LLM-generated summary.
# This should be displayed prominently in your app's approval UI.
console.log(analysis.summary);
// Expected Output: "This transaction grants unlimited spending approval for your USDC to the contract 0xMALICIOUS_CONTRACT_ADDRESS."
console.log(analysis.warnings);
// Expected Output: ["Warning: Granting unlimited approval to a contract is a high-risk operation.", "Warning: The target contract was deployed recently."]
# The user now has clear context to make an informed decision before signing
# the `transactionObject` with their KMS.