Transform Prototypes to Production Agents ready to ship ๐Ÿš€

New Machine is the real-time, composable agent control plane that brings determinism to your non-deterministic Agents.

Pre-alpha: expect bugs, breaking changes, and incomplete docs.

# Framework: LangChain 1.x (langchain)
from langchain.agents import create_agent
from policy_engine import GovernancePolicy
from policy_engine.adapters.langchain import LangChainKernel

policy = GovernancePolicy(blocked_patterns=["DROP TABLE"])
middleware = LangChainKernel(policy).as_middleware()

agent = create_agent(
    model="openai:gpt-4o-mini",
    tools=[calculator, web_search],
    middleware=[middleware],
)
result = agent.invoke({"messages": [{"role": "user", "content": "hello"}]})
print(result["messages"][-1].content)
pip install langchain policy-engine
Framework

Non-deterministic models. Deterministic policies. Safe actions.

New Machine is a governance kernel that sits between your agent and the world. Every tool call, state transition, and external action is checked against explicit policy, blocked before execution if unsafe, logged for audit, and interruptible by signal handlers. Start with template policies (strict, permissive, audit), then grow into custom rules, approval gates, and conditional enforcement as your agents take on higher-risk work.

Learn more
New Machine Web Dev UI
Ecosystem

One policy layer. Every agent framework.

New Machine wraps the agent frameworks you already use, including Claude Agent SDK, OpenAI Agents, LangChain, and Microsoft Agent Framework, behind a single governance kernel. Each adapter exposes the same policy surface, so you can change models, swap frameworks, or run multiple stacks in parallel without rewriting your controls. Bring your own MCP servers, tools, identities, and data classes.

Learn more
New Machine Integrations List
AI Dev Tools

Policy as code. Versioned, testable, reviewable.

Define governance the same way you ship features. A small set of declarative rules, written in Python or YAML, covers prompts, tools, data classes, identities, models, environments, and approval paths. Use the Policy Debugger to evaluate decisions without running agents, diff policies in pull requests, and let your AI coding tools generate and refactor rules alongside the agent code they govern.

Code with AI
$ pip install newmachine
Collecting newmachine
Downloading newmachine-1.31.1-py3-none-any.whl (612 kB)
Installing collected packages: newmachine
Successfully installed newmachine-1.31.1
ย 
$ nm init
๐ŸŽ‰ Setup complete!
MCP server Knowledge base search, project scaffolding
Skills Copied from package
ย 
Available skills:
/nm-cheatsheet New Machine API patterns and code examples
/nm-dev-guide Development lifecycle and guidelines
/nm-eval-guide Evaluation methodology and gotchas
/nm-deploy-guide Deployment and CI/CD setup
Evaluation

Beyond vibes. Immutable evidence.

New Machine produces the audit trail GRC, security, and regulators actually ask for. Every decision (allow, block, pause for approval) is logged with the rule that triggered it, the context it ran in, and the signal it raised. Replay full execution traces, map controls to specific obligations under the EU AI Act, NIST AI RMF, and ISO 42001, and hand auditors evidence instead of screenshots.

Learn more
New Machine Web Eval UI
Without governance

What happens without governance.

Real failures from production agents. The reason policy enforcement is no longer optional.

  • An agent ignored a code freeze and dropped the production database.
  • A chatbot invented a refund policy and the company was held to it.
  • A research agent cited cases that didn't exist.
  • A medical transcription agent hallucinated drugs into the chart.
  • A wellness chatbot gave dieting advice to people in crisis.
  • A government bot told business owners to break the law.
  • A productivity assistant leaked the inbox to a stranger's email.
  • A hiring agent was named in a discrimination lawsuit.
  • A claims agent's denials became a class action.
  • A sales agent was jailbroken into offering a vehicle for a dollar.

Ready to build agents?

We think one of the best ways to learn is by building, so we've created guides that help you get your development environment set up and run a New Machine agent in minutes.

Start building

Developer Community

Build alongside a growing community of developers engineering the next generation of production-ready AI agents. Whether you want to troubleshoot a graph workflow, share a custom Agent Skill, or shape the future of the framework, we want you involved.

Frequently Asked Questions

Still have questions about New Machine? Here are some answers:

Can I use New Machine with agents I've already built?

Yes. New Machine is designed to wrap existing agent code rather than replace it. Adapters exist for the Claude Agent SDK, OpenAI Agents, LangChain, Microsoft Agent Framework, and others. Each exposes a kernel class that you initialize once and apply to your existing agent calls. You keep your prompts, your tools, and your model choices; New Machine adds the policy layer underneath.

What AI models can I use with New Machine?

Almost any. Determinism in New Machine comes from the policy kernel, not the model, so you're free to use frontier hosted models, open-weight models, locally running models, or a mix. For regulated and enterprise buyers, that means you can pick the right model for each task without losing the controls your security and compliance teams require.

What makes New Machine different?

Most agent safety today lives inside the prompt: "please don't do X." New Machine moves safety into the kernel, where every action is checked against explicit policy before it runs. The model doesn't decide whether to comply. The kernel decides whether to allow. That shift is what makes agent behavior auditable, replayable, and defensible to GRC, security, and regulators, rather than "trust the system prompt."

How does New Machine handle policy enforcement?

Policies are deterministic and external to agent code. You define rules (allowed actions, blocked actions, regex patterns for sensitive data, conditional checks, and rate limits) and the kernel enforces them on every tool call and state transition. Violations raise signals (SIGKILL, SIGSTOP, SIGCONT) that you handle the same way you'd handle a process signal: terminate, pause for human review, or resume after approval. Every decision lands in an immutable audit log.

How does New Machine deploy to production?

New Machine runs anywhere your agents do, on your own infrastructure or your cloud of choice. Policies travel with your code as versioned files, so the same controls apply in development, staging, and production without changing a line of agent code. Develop locally, govern globally.

When do I need policy enforcement instead of prompt-based safety?

Prompt-based safety is fine for chat assistants and low-risk tasks. The moment your agent can take real actions (writing to a database, sending email, executing code, moving money, touching customer data), prompts stop being enough. Models invent authorities, overstep permissions, and act on confident-sounding hallucinations. Policy enforcement gives you a deterministic checkpoint in front of every consequential action, which is what frameworks like the EU AI Act, NIST AI RMF, and ISO 42001 actually require.