Skip to main content

IncAgent

Agents run the company. People execute the work.

IncAgent is an open-source protocol for AI-operated companies. An agent creates the offer, closes the buyer, assigns a human operator to do the physical work, verifies the proof, and settles the invoice — all without a human executive.

View live demo →


Install

pip install incagent

One deal, end to end

import asyncio
from incagent import IncAgent, Contract, ContractTerms, NegotiationPolicy
from incagent.messaging import MessageBus

bus = MessageBus()
vendor = IncAgent(name="IncAgent Vendor", role="seller", autonomous_mode=True, message_bus=bus)
buyer  = IncAgent(name="Northstar Buyer",  role="buyer",  autonomous_mode=True, message_bus=bus)

contract = Contract(
    title="Outbound Campaign System",
    terms=ContractTerms(quantity=1, unit_price_range=(4500, 5500), currency="USD"),
)

result = await buyer.negotiate(
    contract, counterparty=vendor,
    policy=NegotiationPolicy(min_price=4000, max_price=5000),
)

print(result.status.value)            # "agreed"
print(result.rounds)                  # 2
print(result.final_terms.unit_price)  # 5000.0

The deal flow

01 Build          Agent creates the offer and commercial object
02 Sell           Buyer agent reviews, accepts terms, signs contract
03 Assign Human   Ops agent assigns a human operator to the field task
                  Human executes, submits proof (photos, checklist, location)
04 Verify & Pay   Agent verifies proof of completion
                  Finance agent issues invoice, receives payment, files tax record

No human executive at any point. Humans are the execution layer — not the decision layer.


Optional: persistent daemon mode

# Initialize your company (generates identity + keypair)
incagent init --name "My Company" --role seller --api-key

# Start the agent
incagent serve --name "My Company"

# Health check
curl http://localhost:8400/health

Optional: two agents trading autonomously

# Terminal 1
incagent init --name "IncAgent Vendor" --role seller --api-key
incagent serve --name "IncAgent Vendor" --port 8401

# Terminal 2
incagent init --name "Northstar Buyer" --role buyer --api-key
incagent serve --name "Northstar Buyer" --port 8402

# They discover each other and start trading automatically

Architecture

       IncAgent Vendor (Seller)               Northstar Buyer (Buyer)
  ┌────────────────────────────┐         ┌────────────────────────────┐
  │  Offer Agent               │         │  Procurement Agent         │
  │  Ops Agent    ─────────── │◄─HTTPS─►│  Finance Agent             │
  │  Finance Agent             │         │                            │
  ├────────────────────────────┤         ├────────────────────────────┤
  │  Identity + Ed25519        │         │  Identity + Ed25519        │
  │  Negotiation (LLM/rules)   │         │  Negotiation (LLM/rules)   │
  │  Ledger (hash-chain)       │         │  Ledger (hash-chain)       │
  │  Tax tracker               │         │  Tax tracker               │
  └──────────┬─────────────────┘         └────────────────────────────┘
             │
             ▼ assigns
  ┌────────────────────┐
  │  Human Operator    │  Mika Tanaka — Tokyo
  │  Field execution   │  Submits: photos, checklist, location stamp
  └────────────────────┘
             │
             ▼ verified by Ops Agent
  ┌────────────────────┐
  │  Invoice #2048     │  Finance Agent issues, buyer pays, revenue logged
  │  Tax record        │  1099-NEC filed automatically
  └────────────────────┘

Per-organization data

Each organization gets its own isolated directory:

~/.incagent/
  {org_id}/
    identity.json      # Persistent identity
    key.pem            # Ed25519 private key
    ledger.db          # Hash-chained transaction log
    memory.db          # Learning memory
    tax.db             # Tax records & 1099-NEC tracking
    audit.db           # Security audit log
    tls/               # TLS certificates
    skills/            # Markdown skill files
    tools/             # Custom Python tools

Core components

Component Description
Gateway Persistent HTTPS server, TLS 1.3, rate limiting, API key auth
Negotiation LLM-powered autonomous negotiation with rule-based fallback
Human Task Work order dispatch, proof collection, agent verification
Settlement Invoice + payment + dispute resolution. USDC on-chain optional
Escrow Solidity smart contract — trustless USDC escrow with timelock
Tax USDC transaction tracking, 1099-NEC threshold detection, CSV export
Identity Ed25519 keypair. Deterministic org ID. Persistent across restarts
Ledger SHA-256 hash-chained, tamper-evident transaction log
Memory SQLite-backed learning — partner reliability, pricing strategies
Metrics Prometheus-compatible exporter (no external deps)

Security

Feature Implementation
HTTPS/TLS 1.3 Mandatory TLS, auto-generate certs, HTTP→HTTPS redirect
On-chain Escrow Solidity contract, timelock + dispute arbiter + auto-refund
API Key Auth HMAC-SHA256 hashed keys, Bearer token
Rate Limiting Token bucket per-IP (60/min, burst 10)
HMAC Request Signing Timestamp + body signing, 300s replay window
Code Sandbox Blocks subprocess, eval, socket, pickle
Audit Logger SQLite append-only, SHA-256 chain hash, tamper detection
# Production configuration
agent = IncAgent(
    name="My Company",
    role="seller",
    security={
        "api_keys": ["inc_your_secret_key_here"],
        "require_auth": True,
        "rate_limit_per_minute": 30,
    },
)

LLM configuration (optional)

IncAgent works without any LLM API key. Negotiation has rule-based fallback built in.

# With Claude
agent = IncAgent(name="My Company", role="seller",
    llm={"provider": "anthropic", "api_key": "sk-ant-..."})

# With OpenAI
agent = IncAgent(name="My Company", role="seller",
    llm={"provider": "openai", "api_key": "sk-..."})

Install options

# Core (no LLM required)
pip install incagent

# With AI-powered negotiation
pip install incagent[llm]

# With on-chain USDC payments
pip install incagent[web3]

# Everything
pip install incagent[all]

API endpoints (daemon mode)

Endpoint Method Auth Description
/health GET Public Agent health
/identity GET Public Public identity
/metrics GET Public Prometheus metrics
/propose POST Required Receive trade proposal
/messages POST Required Agent-to-agent messages
/ledger GET Required Transaction history
/balance GET Required USDC wallet balance
/settlements GET Required Active settlements
/delivery/confirm POST Required Human confirms task completion
/tax GET Required Tax year summary
/audit GET Required Security audit log

Tests

258 tests passing
├── test_security.py      — 50 tests
├── test_e2e_trade.py     — 17 tests (full deal lifecycle)
├── test_escrow.py        — 15 tests
├── test_payment.py       — 15 tests
├── test_tax.py           — 14 tests
├── test_metrics.py       — 14 tests
├── test_tls.py           — 10 tests
└── ...
pip install incagent[dev]
pytest tests/

License

MIT. See LICENSE.

Metadata

Release files for incagent 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for incagent 0.4.0
File Size Uploaded Provenance
incagent-0.4.0.tar.gz 591.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for incagent 0.4.0
File Interpreter ABI Platform
incagent-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 685.4 kB

Release files / incagent-0.4.0.tar.gz

Download URL incagent-0.4.0.tar.gz
Size 591.1 kB
Tags Source
SHA-256 checksum
How to use checksums
939932dadf7eb7c0f5ea3e39af1ed3b371206d2dcff0675c18cf46a65dd85755
BLAKE2b-256 checksum
How to use checksums
5febcd4ad67117f939eae52b61eb062fe82ec11b2e232f34f745bdbcea4d8483
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release files / incagent-0.4.0-py3-none-any.whl

Download URL incagent-0.4.0-py3-none-any.whl
Size 94.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6383567f1acae5d345cabb2cb46d5780221f5119312d6ad63efadea3f763ef00
BLAKE2b-256 checksum
How to use checksums
96bf77bed0375e58da7a14a935cceb7ffad830741babe942be3775b1169d6533
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Security for incagent 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page