Skip to content

test(langchain): add LC-103 fixture coverage - #175

Open
jiaxinaspenlin-dotcom wants to merge 1 commit into
trustabl:mainfrom
jiaxinaspenlin-dotcom:feat/langchain-requests-builtin-tool
Open

test(langchain): add LC-103 fixture coverage#175
jiaxinaspenlin-dotcom wants to merge 1 commit into
trustabl:mainfrom
jiaxinaspenlin-dotcom:feat/langchain-requests-builtin-tool

Conversation

@jiaxinaspenlin-dotcom

Copy link
Copy Markdown

Summary

Adds the engine-side fixture and test coverage for LC-103, which detects LangChain agents that wire langchain_community's Requests* built-in HTTP tools.

What changed

  • Mirrored LC-103 into:
    • testdata/rules-fixture/langchain/agent_safety.yaml
  • Added three agent-rule test cases in:
    • internal/rules/policies_test.go

Coverage includes:

  • FIRE: ReactAgent with RequestsGetTool
  • FIRE: AgentExecutor with RequestsPostTool
  • SILENT: ReactAgent with TavilySearchResults

Every AgentDef sets Language.

No analyzer changes were required because the existing LangChain hosted-tool discovery already recognizes all five Requests* classes.

Validation

  • go vet ./... — pass
  • go test -race ./internal/rules/... — pass
  • go test -race ./... — 26 packages passed, 0 failures
  • go build -o /tmp/trustabl ./cmd/trustabl — pass
  • check-rules-sync.sh — in sync with production

The fixture is byte-identical to the corresponding rule definition in trustabl-rules.

Paired changes

All coordinated changes use the shared branch:

feat/langchain-requests-builtin-tool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant