Railway

Deploy contract-af

Your Own AI Powered Legal Analyst

Deploy contract-af

Agentfield Control Plane

Just deployed

/var/lib/postgresql/data

Just deployed

Just deployed

Deploy and Host contract-af on Railway

Contract-AF is an AI-native legal contract risk analyzer that uses a multi-agent pipeline to review contracts like a senior lawyer — finding risks, tracing cross-references, running adversarial verification, and producing negotiation playbooks. One API call per contract.

About Hosting contract-af

Deploying contract-af involves running two services: the AgentField control plane (orchestrates agent execution) and the contract-af worker (runs the 7-phase analysis pipeline). The control plane exposes the async execution API while the worker registers itself and handles contract analysis requests. Both services are containerized and can be deployed as a linked pair on Railway with shared networking and environment variables.

Common Use Cases

  • Analyze NDAs, SaaS agreements, and employment contracts for hidden risks before signing
  • Integrate contract risk analysis into existing legal workflows via the async API
  • Run adversarial verification on high-stakes agreements to surface cross-clause combination risks

Dependencies for contract-af Hosting

  • Python 3.10+ with the agentfield SDK, FastAPI, and Pydantic
  • OpenRouter API key for LLM access (Kimi K2.5 default, any OpenRouter model works)

Deployment Dependencies

Environment Variables

VariableRequiredDescription
OPENROUTER_API_KEYYesAPI key from OpenRouter for LLM calls
AGENTFIELD_API_KEYNoAPI key when the control plane enforces auth (default: this-is-a-test-key)
HARNESS_MODELNoModel for agent harness (default: openrouter/moonshotai/kimi-k2.5)
AI_MODELNoModel for reasoning (default: openrouter/moonshotai/kimi-k2.5)

Testing Your Deployment

Once deployed, test the contract analysis endpoint with this curl command:

curl -X POST \
  /api/v1/execute/async/contract-af.analyze \
  -H "Authorization: Bearer this-is-a-test-key" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "document_text": "MUTUAL NON-DISCLOSURE AGREEMENT\n\nThis Agreement is entered into between Party A and Party B.\n\n1. CONFIDENTIAL INFORMATION: All proprietary data shared between parties.\n2. OBLIGATIONS: Receiving party shall maintain strict confidentiality for 5 years.\n3. TERM: This agreement remains in effect for 3 years from the date of execution.\n4. GOVERNING LAW: State of Delaware.\n5. REMEDIES: Injunctive relief available for breach.",
      "user_context": "Quick test NDA analysis"
    }
  }'

A successful response returns an execution ID you can use to poll for results:

{
  "execution_id": "exec_20260311_204441_c2up6qpa",
  "run_id": "run_20260311_204441_xoctffbj",
  "workflow_id": "run_20260311_204441_xoctffbj",
  "status": "queued",
  "target": "contract-af.analyze",
  "type": "reasoner",
  "created_at": "2026-03-11T20:44:41Z"
}

Notes on authentication:

  • The default API key this-is-a-test-key is included in the template for quick testing
  • To use your own key, set the AGENTFIELD_API_KEY environment variable in your Railway service settings and pass it in the Authorization: Bearer header
  • Replace `` with your Railway deployment URL (e.g., https://your-service-production-xxxx.up.railway.app)

Why Deploy contract-af on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying contract-af on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
View Template
(v1) Simple Medusa Backend
Deploy an ecommerce backend and admin using Medusa

Shahed Nasser
View Template
peppermint
Docker-compose port for peppermint.sh

HamiltonAI