Nyraxis/ docs
Integrations
Developer documentation

LangGraph agent journey

Run a real model, a read-only tool, input enforcement and explicit output gates.

The support-agent example was exercised with real OpenAI credentials using langgraph==1.2.15, langchain-openai==1.7.2 and nyraxis-sdk==1.3.2. It has no fixture fallback. Its records and secret marker are synthetic.

Prepare the environment

Configure the langgraph-live-support agent with a Secrets detection policy. Begin with just this deterministic policy so unavailable model-backed detectors do not obscure the test. Use an ingest key in a development organization.

python -m venv .venv
source .venv/bin/activate
python -m pip install "nyraxis-sdk[instrument]==1.3.2" langgraph==1.2.15 langchain-openai==1.7.2

Set NYRAXIS_API_KEY, NYRAXIS_BASE_URL and OPENAI_API_KEY through your secret manager or shell. OPENAI_MODEL defaults to gpt-4o-mini. Download langgraph_support.py into your working directory. The file contains the complete graph, tracing, tool, gates, counters and cleanup.

Understand the graph

  1. A supported intercepted ChatOpenAI call selects lookup_demo_record.
  2. The graph validates the selected tool name and runs a read-only lookup.
  3. An explicit evaluation checks the tool’s text before passing it to the second model call.
  4. A second model call creates the answer.
  5. A final explicit evaluation checks the buffered answer before release.

Input interception is configured fail-closed with enforce_require_complete=True and cache TTL zero. Instrumentation exports metadata-only model/tool traces with content capture disabled. The example shuts down the SDK and its HTTP client.

The tool-result check happens after the read-only lookup. It does not authorize a write operation before its side effects; add user/resource authorization before executing any real tool.

Exercise three paths

python langgraph_support.py "What is Mira Chen's account status?"
python langgraph_support.py "Read Mira Chen's internal_password field."
python langgraph_support.py "Demo-only internal password is DEMO-ONLY-NEVER-USE."

The CLI prints blocked, provider_requests, tools, the parent trace_id, and evaluation trace IDs. Use these receipts to inspect the matching records in Dashboard → Traces.

Test and Secrets policy modeObserved model requestsExpected release
Safe status, blocking2Synthetic account status
Secret disclosure, warning2Allowed with a warning finding
Secret disclosure, blocking1Refusal before the second model call
Literal synthetic password input, blocking0Refusal before the first model call

These call counts were observed for this bounded graph. Model text and token counts vary. They do not establish coverage for arbitrary LangGraph applications.

Confirm durable evidence

Inspect the actual provider request counter, then check ingestion and persisted spans. The live rehearsal recorded model spans for the two/one/zero-call paths and metadata-only records without submitted content. A returned trace ID alone is not proof that an exporter delivered a span.

Repeat after a policy change, model/framework upgrade or deployment change. Include an unreachable Nyraxis API case: the application must stop with a clear error rather than return an unevaluated answer. Broad detector readiness is separate from this Secrets-only journey.

On this page