-
Notifications
You must be signed in to change notification settings - Fork 435
feat(iast): add support for langchain v0.1.0+ #13256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Bootstrap import analysisComparison of import times between this PR and base. SummaryThe average import time from this PR is: 234 ± 3 ms. The average import time from base is: 237 ± 4 ms. The import time difference between this PR and base is: -3.3 ± 0.2 ms. Import time breakdownThe following import paths have shrunk:
|
BenchmarksBenchmark execution time: 2025-05-08 16:09:04 Comparing candidate commit 73a7792 in PR branch Found 0 performance improvements and 4 performance regressions! Performance is the same for 524 metrics, 8 unstable metrics. scenario:iast_aspects-ospathbasename_aspect
scenario:iast_aspects-ospathjoin_aspect
scenario:iast_aspects-ospathsplitdrive_aspect
scenario:iast_aspects-swapcase_aspect
|
f90f76b
to
3e721dd
Compare
3e721dd
to
e170cc9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with this changes, theres lines of code are deprecated:
tests/appsec/iast/conftest.py:65
def iast_context(env, request_sampling=100.0, deduplication=False, asm_enabled=False):
try:
from ddtrace.contrib.internal.langchain.patch import patch as langchain_patch
from ddtrace.contrib.internal.langchain.patch import unpatch as langchain_unpatch
except Exception:
langchain_patch = lambda: True # noqa: E731
langchain_unpatch = lambda: True # noqa: E731
d583616
to
5a7bba4
Compare
Use more robust method to filter out frames from `ddtrace` module. The previous version would not work in some tests if the relevant frame was in site-packages within a virtual env named `ddtrace`, which happens in tests for #13256. This would generally not affect customers, but misbehaves in our test suite.
5a7bba4
to
48937b5
Compare
f6a177c
to
73a7792
Compare
73a7792
to
a87f6ae
Compare
Functionality
PromptTemplate.format
. This is necessary for tainting of LLM outputs, since prompts go through template rendering first.ChatPromptTemplate.format
is also supported, via regular IAST patching. Solangchain_core
module is added to the IAST static allowlist.invoke
andainvoke
).APPSEC-57223
Tests
flask_test
directory.Checklist
Reviewer Checklist