LangSmith alternative: LangSmith vs Amiril
A LangSmith alternative for LangGraph agents in production. Amiril reads the same traces and blocks a bad tool call in the agent's process before it runs.
A LangSmith alternative for LangGraph agents in production. Amiril reads the same traces and blocks a bad tool call in the agent's process before it runs.
LangSmith is LangChain's platform for tracing and evaluating agents. LangChain also makes LangGraph, so tracing a graph takes a few environment variables. A trace arrives after the tool has run, though, so it can show a workspace deleted by mistake but can't stop the next run from deleting another. We built Amiril as a LangSmith alternative that does: it reads LangGraph traces too, and it checks every tool call against your rules inside the agent's process before the tool runs.
Set LANGSMITH_TRACING=true, an API key, an agent id and an environment, and each LangGraph run built from LangChain's modules arrives as a trace with no other code change (Trace LangGraph agents). There are SDKs for Python, TypeScript, Go and Java, and LangSmith takes OpenTelemetry data in too (LangSmith Observability).
Dashboards run over those traces, and an online evaluator can have an LLM judge grade each trace that matches a filter (online evaluators). Alerts are thresholds on run count, cost, errors, feedback or latency over a 5 or 15 minute window, sent to Slack, PagerDuty, Dynatrace or a webhook (alerts). LangSmith Engine scans an agent environment on a schedule and groups recurring failures into issues. With a repository connected it also opens a pull request with a proposed fix, and it turns the failing traces into dataset examples so the fix can be tested offline (LangSmith Engine).
Two newer pieces control what an agent may do. The LLM Gateway, in beta, sits between your agents and the model providers and applies model fallbacks, spend limits, rate limits and data policies (LLM Gateway). Tool Gateway, also in beta and on the Plus and Enterprise plans, sits in front of MCP servers (Tool Gateway). A Tool Gateway policy either blocks a tool call or asks the caller to approve it, and it picks the calls it applies to by who is calling and which tool (Tool Gateway policies).
On the pricing page, Developer is $0 for one seat with 5,000 base traces a month and Plus is $39 a seat a month with 10,000, with pay as you go after that. Enterprise is priced on request.
In LangSmith, a problem goes from a trace to an Engine issue and then a pull request. The agent changes once that pull request is merged and deployed, and until then it carries on making the same call.
Say you have a support agent called account_admin, built with create_agent, that can look up who owns a workspace and delete one. Someone writes in saying they own ws-7781 and want it gone. The agent calls verify_owner, which comes back {"verified": false}, and then calls delete_workspace anyway. LangSmith's trace shows both calls in order. No gateway would have stopped the second one, because delete_workspace is a @tool function in your own graph and Tool Gateway only covers tools on MCP servers. Even on an MCP server, a policy picks calls by caller and tool alone, so blocking delete_workspace would stop the real owner's deletion too. Approval is out as well: "An agent that runs with no one present cannot approve calls" (Tool Gateway policies).
Amiril handles it with a rule. This one lets delete_workspace run only after verify_owner said yes for the same workspace, earlier in the same run:
@id("verified-owner-delete") @sentence("Nobody verified the caller as the owner of {workspace} earlier in this run") block ( agent == "account_admin", tool == "delete_workspace" ) unless { workspace = call.args.workspace_id; verified = latest(verify_owner{ args.workspace_id == workspace }).result.verified; verified == true };
When the owner check fails, the model gets this back in place of the tool's result:
The call to delete_workspace was not performed. Rule verified-owner-delete blocked it: Nobody verified the caller as the owner of ws-7781 earlier in this run (verified false). Do not retry this call with different arguments or achieve the same outcome another way; tell the user it was not performed.
With the real owner's email, verify_owner returned true and the deletion went through. Rules can read a call's arguments, earlier calls in the run, or every run in a session, and the rule language tour walks through each. With the middleware in place, the fix is a rule you publish, and the running agent picks it up within about a minute without a deploy.
The LangGraph adapter is middleware for create_agent, and it goes first in the list so no other middleware sees a call before Amiril does:
pip install "amiril[langgraph]"
import amiril
import amiril.langgraph
from langchain.agents import create_agent
amiril.init()
agent = create_agent(
model,
[verify_owner, delete_workspace],
middleware=[amiril.langgraph.middleware()],
name="account_admin",
)
amiril.instrument(agent)amiril.init() reads AMIRIL_API_KEY and AMIRIL_ENDPOINT from the environment, and instrument checks that Amiril's middleware is there and first. The SDK reports each rule's decision to Amiril. Issues and Test on past calls work from traces, which the OpenTelemetry setup further down sends. Rules see the agent under the name you give it. A Python StateGraph you built by hand takes Amiril's ToolNode in place of LangGraph's, and TypeScript uses @amiril/sdk-langgraph with createAgent (LangGraph SDK guide).
The SDK keeps a copy of your published rules in the agent's process and checks each call against it, so a check makes no network request. It asks Amiril for changes about once a minute. If Amiril can't be reached it keeps enforcing the last rules it had, and it saves them to disk so a restart doesn't lose them (how rules reach your agent).
A new rule starts in Shadow. It checks every call and records what it would have done, and the call runs either way. Before that, Test on past calls replays any version of a rule over the last 24 hours, 7 days or 30 days of traced calls and lists each call it would have fired on (test a rule). When the list holds only calls you meant to stop, you switch the rule to Enforce on its page.
You don't have to write every rule from scratch. When runs share a problem, Amiril groups them into an issue, and an AI investigator reads a sample of them. If a rule would have stopped them, Amiril drafts it and tests it on past runs. It keeps the draft only if it catches some of the issue's runs and fires on at most one in a hundred of the agent's other runs. The draft shows as a rule suggestion with a line such as "Would have blocked 4 of 5 runs", and Create rule opens it in the editor (rule suggestions). To see a suggestion through to Enforce, read the post on LangGraph tool call guardrails.
| Feature | Amiril | LangSmith |
|---|---|---|
| Blocks a tool call before it runs | Yes, in the agent's process | MCP tool calls through Tool Gateway, in beta, on Plus and Enterprise |
| What a check can read | Arguments, earlier calls, other runs in the session | The caller and the tool name |
| What a found problem turns into | A rule suggestion, drafted and tested on past runs | An Engine issue with a proposed pull request |
| Trying a check before it blocks | Shadow, and Test on past calls over 24 hours, 7 days or 30 days | Policies apply from the next call |
| Groups runs that share a problem | Issues, with a severity and a state | Engine issues, ranked by severity |
| LangGraph traces in | OpenTelemetry, with OpenInference's LangChain instrumentation | Built in, through environment variables |
| Starting price | Free plan; Team $249 a month | Developer $0 for one seat; Plus $39 a seat a month |
Amiril reads LangGraph traces over OpenTelemetry. OpenInference's LangChain instrumentation records each run and an exporter sends it:
pip install openinference-instrumentation-langchain opentelemetry-sdk opentelemetry-exporter-otlp-proto-http
from openinference.instrumentation.langchain import LangChainInstrumentor from opentelemetry import trace from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor provider = TracerProvider() provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter())) trace.set_tracer_provider(provider) LangChainInstrumentor().instrument(tracer_provider=provider)
The endpoint and an API key come from the Data page in Amiril, under Set up a new installation, and go in the standard OpenTelemetry variables:
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="<OpenTelemetry traces endpoint>" export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL="http/protobuf" export OTEL_EXPORTER_OTLP_TRACES_HEADERS="Authorization=Bearer <your API key>"
None of this touches LangSmith's own tracing. With LANGSMITH_TRACING=true and OpenInference both switched on, each picks up the run, so you can leave LangSmith in place for as long as you like. Amiril files each run under the agent's name, the one you pass to create_agent or to compile on a graph you built yourself (LangGraph traces guide).
Once traces arrive, Amiril learns what is normal for each agent from that agent's own runs and ranks every new run by rarity. A run's page lists the rarity factors that made it stand out, and runs with the same problem become an issue. With Slack connected you get a message when an issue forms at High or above, plus a daily digest. We followed one run from trace to rule in LangGraph monitoring in production.
If you're after a LangSmith alternative because one of your agents keeps calling a tool it shouldn't, write a rule for that tool first and watch it in Shadow. Rule suggestions are drafted from the agent's own runs, so the first rules need no guessed thresholds.
LangSmith's evals, datasets and prompt tools can stay where they are. For Google ADK, LiveKit and the other frameworks Amiril's rules support, see AI agent guardrails.
You can drop LangSmith or keep it for evals. Amiril's middleware checks tool calls either way. Test on past calls and rule suggestions work from the runs the OpenTelemetry setup above sends.
Yes. In Python, swap LangGraph's ToolNode for Amiril's. It takes the same arguments, and instrument checks every ToolNode in the graph and its subgraphs. The LangGraph SDK guide has the code.
You write them in the web app, or an AI assistant such as Claude writes and tests them through Amiril's MCP server. Amiril also drafts rule suggestions from issues, and you create the rule from the suggestion.
Amiril has a free plan and a Team plan at $249 a month, and the pricing page lists what each one includes.