OpenFief

Open source · self-hosted · early

Give your AI agents a fief, not the kingdom.

OpenFief tracks everything you own across brokers, then lets AI agents trade a slice of it. Each agent gets a revocable capital lease, a fief, with limits enforced by code and separate broker accounts, never by a prompt.

Read the docs See the architecture GitHub

Milestone M0 in progress: a tracker with Polish broker and treasury bond imports. Agents come later. Not ready for real money yet.

Verified as it's built

Every design decision has an ID, every requirement is traced to the code and the tests behind it, and a docs page that falls behind its code fails the build. This build counts the decisions:

See every decision and its evidence

Where it’s going#

OpenFief is built in milestones. The tracker comes first; the agents follow on top of it. This is the planned flow for one agent:

  1. Spawn a thesis agent. “Company X is undervalued; three-year horizon.” Give it a fief of 5,000 PLN. It sees its thesis, public data and its own fief, nothing else.
  2. It proposes a trade: a limit order, its reasoning, and what would prove the thesis wrong. The gateway checks it against the lease and your rules.
  3. You approve it on your phone. The order goes to a separate broker account that holds only capital set aside for agents.
  4. Pull the kill switch if something looks off. The agent loses its trading rights, its open orders are cancelled, and the rest of your portfolio is untouched.

trade proposal

approval request

approve

order

revoke and cancel

Thesis agent
in its own pod

OpenFief gateway
lease and rules check

Your phone

Separate broker account

Kill switch

trade proposal

approval request

approve

order

revoke and cancel

Thesis agent
in its own pod

OpenFief gateway
lease and rules check

Your phone

Separate broker account

Kill switch

Why a fief#

In medieval Europe, a lord granted a vassal a fief: land to run as the vassal saw fit, held on conditions, and taken back when they broke. The vassal ruled the fief, never the kingdom. OpenFief makes the same deal with software agents, and writes the conditions in code.

Help shape it#

The design is public, with every decision numbered and every proposal open to critique. The most useful input now is a hard look at the security model, and experience with the Interactive Brokers API or its linked accounts as a Polish resident. Start with the overview, then the architecture.