Foundry Integration
The agenta proxy command starts a JSON-RPC signing proxy on localhost. It intercepts eth_sendTransaction and eth_signTransaction, signs via Agenta’s threshold protocol, and forwards everything else to the upstream RPC.
Your Forge scripts deploy with threshold signing. No private keys in your environment.
Start the Proxy
The proxy:
- Loads your signer share from local config
- Connects to the AgentaOS server for co-signing
- Listens on
http://localhost:8545
The proxy intercepts eth_sendTransaction, eth_signTransaction, eth_sign, personal_sign, and eth_accounts. All other JSON-RPC methods (like eth_getBalance, eth_call) pass through to the upstream RPC.
Forge Scripts
Point Forge at the proxy. No --private-key flag needed.
forge script script/Deploy.s.sol \
--rpc-url http://localhost:8545 \
--broadcast
The proxy handles eth_accounts too. Forge automatically picks up your Agenta signer address.
pragma solidity ^0.8.20;
import "forge-std/Script.sol";
import "./MyContract.sol";
contract Deploy is Script {
function run() external {
vm.startBroadcast();
new MyContract();
vm.stopBroadcast();
}
}
Cast
Send transactions with cast through the proxy.
cast send 0xContractAddress "mint(uint256)" 1 \
--rpc-url http://localhost:8545
cast send 0xRecipient --value 0.01ether \
--rpc-url http://localhost:8545
Hardhat
Set the Agenta proxy as a custom network in your Hardhat config.
module.exports = {
networks: {
agenta: {
url: "http://localhost:8545",
},
},
};
No accounts config needed. The proxy provides the signer address via eth_accounts.
Proxy Options
| Flag | Description | Default |
|---|
-p, --port <port> | Port to listen on | 8545 |
-r, --rpc-url <url> | Override upstream RPC URL | Auto-detected from server |
Override the RPC if you need a specific endpoint:
agenta proxy --port 8545 --rpc-url https://mainnet.base.org
What Gets Signed
| JSON-RPC Method | Action |
|---|
eth_sendTransaction | Threshold sign + broadcast |
eth_signTransaction | Threshold sign (no broadcast) |
eth_sign | Threshold message sign |
personal_sign | Threshold message sign |
eth_accounts | Returns Agenta signer address |
| Everything else | Forwarded to upstream RPC |
The server evaluates all active guardrails before co-signing. Spending limits, rate limits, and contract allowlists all apply — even through the proxy. If a guardrail blocks the transaction, Forge gets a JSON-RPC error with the violation details.