Resources
Developer Resources
5 min read

Asyrx for LangChain: scoring agent tool calls before they run

LangChain made it simple to give agents tools. Asyrx makes it simple to know which of those tool calls deserve a second look before they execute.

Asyrx Research

Chain of glowing agent workflow nodes passing through a scanning gate before reaching tools

LangChain is one of the most widely used frameworks for building AI agents, and its wider stack — LangGraph for stateful, multi-step agent workflows and LangSmith for tracing and evaluation — has become a default choice for engineering teams moving agents into production. That success creates a specific problem: once an agent has tools, every tool call is a potential action against a real system.

Asyrx is a natural fit for the LangChain stack because the framework already has a clear place to put an assessment: the moment between an agent deciding to call a tool and the tool actually executing.

Where Asyrx sits in a LangChain agent

In a typical LangGraph workflow, the model proposes a tool call, the graph routes to a tool node, and the tool runs. Asyrx adds one step for consequential tools: before the tool node executes, the workflow sends the proposed action — actor, action type, target system, scope and relevant context — to the Asyrx assessment API. Asyrx returns an Action Risk Score, a Blast Radius Score, confidence, risk factors, reason codes and advisory recommended controls.

The graph then decides what to do. LangGraph's support for conditional edges and human-in-the-loop interrupts makes this straightforward: low-band results continue, while higher-band results can route to a review step that your team defines. Asyrx supplies the signal; the workflow and its owners retain the decision.

Example LangChain tool calls and what Asyrx adds
Tool callWhy it mattersAsyrx signal
SQL tool runs an UPDATE without a narrow WHERE clauseCan change thousands of rowsHigh Blast Radius Score, data-scope reason codes
Email tool sends to an external distribution listData leaves the organizationExternal destination and novelty context
Payments tool issues a refundDirect financial impactFinancial risk factors compared with behavioral history
Shell or code tool modifies infrastructureProduction availabilityPrivilege and environment reason codes
CRM tool exports contact recordsCustomer data exposureSensitive-data and volume risk factors

Why framework teams benefit

Framework-level guardrails usually focus on model input and output: prompt injection, content filtering, output format. Those matter, but they are not action-aware. A perfectly well-formed tool call can still be the most consequential thing the agent does all week. Asyrx evaluates the action itself, using behavioral context from the agent's own history and policy context from the organization, so a refund that is normal for one agent can be flagged as unusual for another.

Because the assessment is a single API call, it works the same way whether the agent is a simple LangChain tool-calling agent, a multi-agent LangGraph supervisor, or a deployed LangGraph Platform application. Teams that trace with LangSmith can attach the Asyrx assessment ID to the run, giving a joined record of what the agent proposed, how it was scored, and what the workflow did next.

Routing LangGraph tool calls by Asyrx score band
Low (0–39)0–39
Moderate (40–64)40–64
High (65–84)65–84
Critical (85–100)85–100

Conceptual illustration of the published Asyrx score bands. Routing choices are defined by your team, not by Asyrx.

Designing the fallback

If Asyrx returns ASSESSMENT_UNAVAILABLE, that is not an approval and not a denial. Decide ahead of time, per tool category, whether the graph proceeds, queues the action or escalates it. Never treat an unknown result as low risk for tools that touch money, permissions or customer data.

Adding Asyrx to a LangChain project

  • List the agent's tools and mark which ones are consequential.
  • Wrap those tools so they call the Asyrx assessment API before executing.
  • Use idempotency keys so retries in the graph do not create duplicate assessments.
  • Route higher-band results to a LangGraph interrupt or review node.
  • Attach the assessment ID to your trace for audit.
  • Define the unavailable-assessment fallback for each tool category.

Frequently asked questions

Does Asyrx have a LangChain integration?
Asyrx works with LangChain and LangGraph through its assessment API: one call before a consequential tool executes. No changes to the framework are required, and the same pattern works across agent architectures.
Does Asyrx replace LangChain guardrails?
No. Input and output guardrails remain useful. Asyrx adds action-level assessment of the proposed tool call itself, including behavioral and policy context.
Does Asyrx stop a tool call?
No. Asyrx returns decision-support risk intelligence. Your graph, policies and reviewers decide whether the tool call proceeds.
Should every tool call be assessed?
Usually not. Assess tools that touch money, customer data, permissions, external destinations or production systems. Routine read-only tools rarely need assessment.
How does this work with LangSmith?
You can attach the Asyrx assessment ID and scores to the run metadata, creating a joined record of the proposal, its assessment and the workflow's next step.
Is Asyrx affiliated with LangChain?
No. Asyrx is operated independently by Thought Media™ and integrates with LangChain-based agents through its public assessment API.
LangChainLangGraphIntegrationsDevelopers