Skip to content

mmdcodee/runway-agent-cfo

Repository files navigation

Runway Agent CFO

Chinese README

Runway Agent CFO is an agentic wallet CFO for AI builders. It turns compute budgets, API spend, cloud costs, and runway goals into policy-controlled on-chain decisions, using Byreal CLI dry-runs and Mantle Testnet evidence records.

The project is built for The Turing Test Hackathon 2026 on DoraHacks.

Track

  • Track: Agentic Wallets & Economy
  • Path: AI Driven - RealClaw Real-Life Expansion
  • Target awards: Track First Prize, 20 Project Deployment Award, Best UI/UX Award

One-Line Pitch

Runway Agent CFO helps AI builders turn compute budgets and runway goals into risk-controlled on-chain actions, with Byreal-powered dry-runs and audit-ready decision logs on Mantle.

What It Does

AI teams often hold grant funds or hackathon winnings while spending heavily on OpenAI APIs, GPU rental, hosting, and observability. Runway Agent CFO lets a team describe its monthly burn, treasury assets, runway target, and risk policy. The agent then:

  1. Calculates runway and operating reserve requirements.
  2. Calls Byreal CLI tools for wallet checks, pool lookup, and swap dry-run previews.
  3. Uses policy rules to block, allow, or require confirmation.
  4. Self-corrects when live slippage exceeds policy by retrying smaller notionals.
  5. Records agent identity, user intent, decision hash, tool trace hash, and benchmark metrics on Mantle Testnet.

No real swap is executed by default. The current demo is dry-run only.

Current Demo State

  • Frontend dashboard: implemented locally with live decision stream, model plan, policy console, tool call trace, dry-run comparison, on-chain evidence, and benchmark card.
  • Agent backend: Python planner, OpenAI-compatible model planning, policy judge, Byreal CLI executor, evidence builder.
  • Byreal integration: real CLI calls for wallet balance, pool lookup, and swap dry-run, with explicit fallback status if a tool is unavailable.
  • Mantle integration: RunwayPolicyRegistry deployed to Mantle Testnet with Phase 2 and Phase 3 evidence flows.
  • Tests: ruff, pytest, TypeScript check, and contract compile scripts are available.

Public demo URL and demo video URL are still to be added before final DoraHacks submission.

Mantle Testnet Deployment

Phase 3 Evidence Flow

  • Agent ID: 3
  • Intent ID: 3
  • Decision ID: 3
  • Benchmark ID: 3
  • registerAgent: 0xb2874f6fc0d497d6723af056beec4d610f88185ede3777deaec5cd41506842b5
  • createIntent: 0x77dc34a30ae2ed6351ccf47a14f16eb30cf4f832d946fcb3b07f56a8cf9d6505
  • recordDecision: 0x78132addee84d8936237b8f83356014bc7a671e655f8e5dcc9a7027141c61ee6
  • recordBenchmark: 0x8fc337198ed00c7e9bcbf4da787d7e63203244051a9d1bb2ffa1c6f943a03b20

The Phase 3 flow uses the same deployed registry and records the latest Byreal-powered tool evidence.

Architecture

User scenario
  -> Python Runway Agent
  -> OpenAI-compatible planner
  -> Byreal CLI tools
       - wallet balance
       - pool lookup
       - swap dry-run
  -> Policy judge
  -> Self-correction on slippage breach
  -> Evidence JSON + SHA-256 / keccak hashes
  -> Mantle RunwayPolicyRegistry
  -> Next.js dashboard

Repository Layout

contracts/      Solidity registry contract
deployments/    Mantle Testnet deployment and flow records
docs/           Public submission notes and final checklist
scripts/        Contract compile, deploy, evidence write, verification scripts
src/agent/      Python agent, policy, Byreal executor, evidence builder
src/frontend/   Next.js dashboard
tests/          Unit tests and scenario fixtures

Quick Start

1. Install Python dependencies

cd runway-agent-cfo
D:\anaconda3\envs\mantle-tt-2026\Scripts\pip.exe install -r requirements.txt

2. Install Node dependencies

npm.cmd install
npm.cmd --prefix src/frontend install

3. Configure environment

copy .env.example .env

Fill server-side values in .env. Never commit .env.

Important fields:

MANTLE_RPC_URL=https://rpc.testnet.mantle.xyz
MANTLE_CHAIN_ID=5003
PRIVATE_KEY=
OPENAI_API_KEY=
OPENAI_API_BASE_URL=
BYREAL_CLI_PATH=
BYREAL_TOKEN_MINTS=

4. Run the frontend locally

npm.cmd run dev:frontend

Open http://localhost:3000.

5. Run the agent locally

Mock tools:

$env:PYTHONPATH='src/agent'
D:\anaconda3\envs\mantle-tt-2026\python.exe -m runway_agent.main `
  --scenario tests\scenarios\ai_team_runway_1500.json `
  --executor mock `
  --json-only

Real Byreal CLI dry-run:

$env:PYTHONPATH='src/agent'
D:\anaconda3\envs\mantle-tt-2026\python.exe -m runway_agent.main `
  --scenario tests\scenarios\ai_team_runway_1500.json `
  --evidence-out reports\evidence\phase3_ai_team_runway_1500.json `
  --executor byreal_cli `
  --planner openai `
  --json-only

6. Verify Mantle evidence

npm.cmd run phase3:verify

Quality Checks

D:\anaconda3\envs\mantle-tt-2026\python.exe -m ruff check --no-cache src/agent tests
$env:PYTHONPATH='src/agent'
D:\anaconda3\envs\mantle-tt-2026\python.exe -m pytest -q -p no:cacheprovider
npm.cmd exec -- tsc --noEmit --incremental false --prefix src/frontend
npm.cmd run compile:contracts

Security Notes

  • The agent never asks users to paste private keys into the UI.
  • .env is ignored and must not be committed.
  • .env.example contains placeholders only.
  • Live swap execution is disabled by default through BYREAL_ENABLE_EXECUTION=false.
  • The current demo is dry-run only; no real funds are moved.

Submission Documents

License

MIT

About

Policy-controlled treasury agent for AI teams, with Byreal dry-runs and Mantle on-chain evidence.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors