diff --git a/.gitignore b/.gitignore index 542f761..1d5f469 100644 --- a/.gitignore +++ b/.gitignore @@ -216,3 +216,6 @@ group-exercise/ # Generated vector databases (large files) vector_databases/*.faiss/ + +# Agent step output files (generated by running exercises) +**/steps/ diff --git a/requirements.txt b/requirements.txt index b9dcb91..eeeb640 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,193 +1,225 @@ -accelerate==1.10.0 -aiofiles==24.1.0 -aiohappyeyeballs==2.6.1 -aiohttp==3.12.15 +accelerate==1.14.0 +aiofiles==25.1.0 +aiohappyeyeballs==2.7.1 +aiohttp==3.14.3 aiosignal==1.4.0 -aiosqlite==0.21.0 -annotated-types==0.7.0 -anthropic==0.89.0 +aiosqlite==0.22.1 +annotated-doc==0.0.5 +annotated-types==0.8.0 +anthropic==0.120.2 antlr4-python3-runtime==4.9.3 -anyio==4.10.0 -attrs==25.3.0 +anyio==4.14.2 +attrs==26.1.0 backoff==2.2.1 -beautifulsoup4==4.13.4 -boto3==1.42.83 -botocore==1.42.83 -bracex==2.6 -cachetools==5.5.2 -certifi==2025.8.3 -cffi==1.17.1 -chardet==5.2.0 -charset-normalizer==3.4.3 -click==8.2.1 +beautifulsoup4==4.15.0 +blis==1.3.3 +boto3==1.43.61 +botocore==1.43.61 +bracex==3.0.1 +cachetools==7.1.6 +catalogue==2.0.10 +certifi==2026.7.22 +cffi==2.1.0 +chardet==7.4.3 +charset-normalizer==3.4.9 +click==8.4.2 +cloudpathlib==0.24.0 colorama==0.4.6 coloredlogs==15.0.1 +confection==1.3.3 contourpy==1.3.3 -cryptography==45.0.6 +cryptography==49.0.0 cycler==0.12.1 +cymem==2.0.13 dataclasses-json==0.6.7 -deepagents==0.4.12 -Deprecated==1.2.18 +deepagents==0.7.1 +defusedxml==0.7.1 +Deprecated==1.3.1 distro==1.9.0 -docstring_parser==0.17.0 +docstring_parser==0.18.0 effdet==0.4.1 -emoji==2.14.1 -eval_type_backport==0.2.0 -faiss-cpu==1.11.0.post1 -filelock==3.18.0 +emoji==2.15.0 +eval_type_backport==0.4.0 +Events==0.5 +faiss-cpu==1.14.3 +filelock==3.32.2 filetype==1.2.0 -flatbuffers==25.2.10 -fonttools==4.59.0 -frozenlist==1.7.0 -fsspec==2025.7.0 +flatbuffers==25.12.19 +fonttools==4.63.0 +frozenlist==1.8.0 +fsspec==2026.7.0 gitdb==4.0.12 -GitPython==3.1.45 -google-api-core==2.25.1 -google-auth==2.49.1 -google-cloud-vision==3.10.2 -google-genai==1.63.0 -googleapis-common-protos==1.70.0 -grpcio==1.74.0 -grpcio-status==1.74.0 +GitPython==3.1.57 +google-api-core==2.33.0 +google-auth==2.56.2 +google-cloud-vision==3.15.0 +google-genai==2.16.0 +googleapis-common-protos==1.75.0 +grpcio==1.83.0 +grpcio-status==1.83.0 h11==0.16.0 -hf-xet==1.1.7 +hf-xet==1.5.2 html5lib==1.1 httpcore==1.0.9 httpx==0.28.1 -httpx-sse==0.4.1 -huggingface-hub==0.34.4 +httpx-sse==0.4.3 +huggingface_hub==0.36.2 humanfriendly==10.0 -idna==3.10 +idna==3.18 iniconfig==2.3.0 +installer==0.7.0 iopath==0.1.10 Jinja2==3.1.6 -jiter==0.13.0 -jmespath==1.0.1 -joblib==1.5.1 +jiter==0.16.0 +jmespath==1.1.0 +joblib==1.5.3 jsonpatch==1.33 -jsonpath-python==1.0.6 -jsonpointer==3.0.0 -jsonschema==4.25.1 +jsonpath-python==1.1.6 +jsonpointer==3.1.1 +jsonschema==4.26.0 jsonschema-specifications==2025.9.1 -kiwisolver==1.4.9 -langchain==1.2.15 -langchain-anthropic==1.4.0 -langchain-aws==1.4.3 -langchain-classic==1.0.3 -langchain-community==0.4.1 -langchain-core==1.2.26 -langchain-google-genai==4.2.0 -langchain-ollama==0.3.10 -langchain-text-splitters==1.1.1 +kiwisolver==1.5.0 +langchain==1.3.14 +langchain-anthropic==1.5.3 +langchain-aws==1.6.4 +langchain-classic==1.0.8 +langchain-community==0.4.2 +langchain-core==1.5.3 +langchain-google-genai==4.3.2 +langchain-ollama==1.1.0 +langchain-protocol==0.0.18 +langchain-text-splitters==1.1.2 langdetect==1.0.9 -langgraph==1.1.6 -langgraph-checkpoint==2.1.1 -langgraph-prebuilt==1.0.9 -langgraph-sdk==0.3.12 -langsmith==0.4.13 +langgraph==1.2.10 +langgraph-checkpoint==4.1.1 +langgraph-prebuilt==1.1.0 +langgraph-sdk==0.4.2 +langsmith==0.10.14 layoutparser==0.3.4 -lxml==6.0.0 -Markdown==3.8.2 -MarkupSafe==3.0.2 -marshmallow==3.26.1 -matplotlib==3.10.5 +llvmlite==0.48.0 +lxml==6.1.1 +Markdown==3.10.3 +markdown-it-py==4.2.0 +MarkupSafe==3.0.3 +marshmallow==3.26.2 +matplotlib==3.11.1 +mdurl==0.1.2 +ml_dtypes==0.5.4 mpmath==1.3.0 -multidict==6.6.3 +multidict==6.7.1 +murmurhash==1.0.15 mypy_extensions==1.1.0 nest-asyncio==1.6.0 -networkx==3.5 -nltk==3.9.1 -numpy==2.2.6 +networkx==3.6.1 +nltk==3.10.0 +numba==0.66.0 +numpy==2.4.6 olefile==0.47 -ollama==0.6.1 -omegaconf==2.3.0 -onnx==1.18.0 -onnxruntime==1.22.1 -opencv-python==4.12.0.88 -orjson==3.11.8 -ormsgpack==1.10.0 -packaging==25.0 -pandas==2.3.1 +ollama==0.6.2 +omegaconf==2.3.1 +onnx==1.22.0 +onnxruntime==1.28.0 +opencv-python==4.14.0.94 +opensearch-protobufs==1.2.0 +opensearch-py==3.2.0 +orjson==3.11.9 +ormsgpack==1.12.2 +packaging==26.2 +pandas==2.3.3 pdf2image==1.17.0 -pdfminer.six==20231228 -pdfplumber==0.11.4 -pi_heif==1.1.0 -pikepdf==9.10.2 -pillow==11.3.0 +pdfminer.six==20251230 +pdfplumber==0.11.9 +pi_heif==1.4.0 +pikepdf==9.11.0 +pillow==12.3.0 pinecone-client==6.0.0 pinecone-plugin-interface==0.0.7 pluggy==1.6.0 -portalocker==3.0.0 -propcache==0.3.2 -proto-plus==1.26.1 -protobuf==6.31.1 -psutil==7.0.0 -pyasn1==0.6.1 +portalocker==3.2.0 +preshed==3.0.13 +propcache==0.5.2 +proto-plus==1.28.2 +protobuf==6.33.6 +psutil==7.2.2 +psycopg2-binary==2.9.12 +pyasn1==0.6.4 pyasn1_modules==0.4.2 -pycocotools==2.0.10 -pycparser==2.22 -pydantic==2.11.7 -pydantic-settings==2.10.1 -pydantic_core==2.33.2 -Pygments==2.19.2 -PyJWT==2.10.1 -PyNaCl==1.5.0 -pyparsing==3.2.3 +pycocotools==2.0.11 +pycparser==2.23 +pydantic==2.13.4 +pydantic-settings==2.14.2 +pydantic_core==2.46.4 +Pygments==2.20.0 +PyJWT==2.13.0 +PyNaCl==1.6.2 +pyparsing==3.3.2 pypdf==5.9.0 pypdfium2==4.30.0 -pytest==9.0.1 +pytest==9.1.1 python-dateutil==2.9.0.post0 -python-dotenv==1.1.1 -python-iso639==2025.2.18 +python-dotenv==1.2.2 +python-iso639==2026.7.23 python-magic==0.4.27 -python-multipart==0.0.20 +python-multipart==0.0.32 python-oxmsg==0.0.2 -pytz==2025.2 -PyYAML==6.0.2 -RapidFuzz==3.13.0 -redis==4.6.0 +pytz==2026.3.post1 +PyYAML==6.0.3 +RapidFuzz==3.14.5 +redis==5.3.1 referencing==0.37.0 -regex==2025.7.34 -requests==2.33.1 +regex==2026.7.19 +requests==2.34.2 +requests-aws4auth==1.3.2 requests-toolbelt==1.0.0 -rpds-py==0.30.0 +rich==15.0.0 +rpds-py==2026.6.3 rsa==4.9.1 -s3transfer==0.16.0 -safetensors==0.6.2 -scipy==1.16.3 -setuptools==80.9.0 +s3transfer==0.19.2 +safetensors==0.8.0 +scipy==1.18.0 +setuptools==83.0.0 +shellingham==1.5.4 six==1.17.0 -smmap==5.0.2 +smart_open==8.0.1 +smmap==5.0.3 sniffio==1.3.1 -soupsieve==2.7 -SQLAlchemy==2.0.42 -sqlite-vec==0.1.6 +soupsieve==2.9.1 +spacy==3.8.14 +spacy-legacy==3.0.12 +spacy-loggers==1.0.5 +SQLAlchemy==2.0.51 +sqlite-vec==0.1.9 +srsly==2.5.3 sympy==1.14.0 -tenacity==9.1.2 +tenacity==9.1.4 tesseract==0.1.3 -tiktoken==0.8.0 -timm==1.0.19 -tokenizers==0.21.4 -torch==2.9.1 -torchvision==0.24.1 -tqdm==4.67.1 -transformers==4.55.0 +thinc==8.3.13 +tiktoken==0.13.0 +timm==1.0.28 +tokenizers==0.22.2 +torch==2.13.0 +torchvision==0.28.0 +tqdm==4.70.0 +transformers==4.57.6 tree-sitter==0.21.3 tree-sitter-languages==1.10.2 +typer==0.27.0 typing-inspect==0.9.0 -typing-inspection==0.4.1 -typing_extensions==4.14.1 -tzdata==2025.2 -unstructured==0.18.11 -unstructured-client==0.42.2 -unstructured-inference==1.0.5 +typing-inspection==0.4.2 +typing_extensions==4.16.0 +tzdata==2026.3 +unstructured==0.21.5 +unstructured-client==0.42.3 unstructured.pytesseract==0.3.15 -urllib3==2.5.0 -uuid_utils==0.14.0 -wcmatch==10.1 +unstructured_inference==1.1.7 +urllib3==2.7.0 +uuid_utils==0.17.0 +wasabi==1.1.3 +wcmatch==11.0 +weasel==1.0.0 webencodings==0.5.1 websockets==15.0.1 -wrapt==1.17.2 -xxhash==3.6.0 -yarl==1.20.1 -zstandard==0.23.0 +wrapt==1.17.3 +xxhash==3.8.1 +yarl==1.24.5 +zstandard==0.25.0 diff --git a/scripts/exercise-00/chatbot.py b/scripts/exercise-00/chatbot.py index 5c38c6e..56059a9 100644 --- a/scripts/exercise-00/chatbot.py +++ b/scripts/exercise-00/chatbot.py @@ -1,5 +1,9 @@ import os +import warnings os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE" # Fix for OpenMP issue on macOS +warnings.filterwarnings("ignore", category=DeprecationWarning, message=".*langchain-community.*") +from langchain_core._api.deprecation import LangChainDeprecationWarning +warnings.filterwarnings("ignore", category=LangChainDeprecationWarning) from langchain_core.prompts import PromptTemplate from langchain_aws import ChatBedrock diff --git a/scripts/exercise-00/chatbot_ollama.py b/scripts/exercise-00/chatbot_ollama.py index a05f2ec..77d7aee 100644 --- a/scripts/exercise-00/chatbot_ollama.py +++ b/scripts/exercise-00/chatbot_ollama.py @@ -1,5 +1,9 @@ import os +import warnings os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE" # Fix for OpenMP issue on macOS +warnings.filterwarnings("ignore", category=DeprecationWarning, message=".*langchain-community.*") +from langchain_core._api.deprecation import LangChainDeprecationWarning +warnings.filterwarnings("ignore", category=LangChainDeprecationWarning) from langchain_core.prompts import PromptTemplate from langchain_ollama import OllamaLLM as Ollama diff --git a/scripts/exercise-01/prompt_engineering.py b/scripts/exercise-01/prompt_engineering.py index 4b7de6e..cdb5b93 100644 --- a/scripts/exercise-01/prompt_engineering.py +++ b/scripts/exercise-01/prompt_engineering.py @@ -1,5 +1,7 @@ import os +import warnings os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE" # Fix for OpenMP issue on macOS +warnings.filterwarnings("ignore", message=".*langchain-community.*") from langchain_community.vectorstores import FAISS from langchain_core.prompts import ChatPromptTemplate diff --git a/scripts/exercise-02/building_with_context.py b/scripts/exercise-02/building_with_context.py index eb9f1d1..b342b90 100644 --- a/scripts/exercise-02/building_with_context.py +++ b/scripts/exercise-02/building_with_context.py @@ -1,5 +1,7 @@ import os +import warnings os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE" # Fix for OpenMP issue on macOS +warnings.filterwarnings("ignore", message=".*langchain-community.*") from langchain_community.vectorstores import FAISS from langchain_core.prompts import ChatPromptTemplate diff --git a/scripts/exercise-04/embed_and_store.py b/scripts/exercise-04/embed_and_store.py index d8040c5..51ddbea 100644 --- a/scripts/exercise-04/embed_and_store.py +++ b/scripts/exercise-04/embed_and_store.py @@ -1,5 +1,7 @@ import os import git +import warnings +warnings.filterwarnings("ignore", message=".*langchain-community.*") from langchain_community.document_loaders.generic import GenericLoader from langchain_community.document_loaders.parsers import LanguageParser from langchain_text_splitters import Language, RecursiveCharacterTextSplitter diff --git a/scripts/exercise-05/chatbot.py b/scripts/exercise-05/chatbot.py index 0d755b6..437fdd9 100644 --- a/scripts/exercise-05/chatbot.py +++ b/scripts/exercise-05/chatbot.py @@ -1,5 +1,9 @@ import os +import warnings os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE" # Fix for OpenMP issue on macOS +warnings.filterwarnings("ignore", category=DeprecationWarning, message=".*langchain-community.*") +from langchain_core._api.deprecation import LangChainDeprecationWarning +warnings.filterwarnings("ignore", category=LangChainDeprecationWarning) from langchain_core.prompts import PromptTemplate from langchain_aws import ChatBedrock diff --git a/scripts/exercise-05/chatbot_prompti_prevention_example.py b/scripts/exercise-05/chatbot_prompti_prevention_example.py index 1aa1853..f4f1b2f 100644 --- a/scripts/exercise-05/chatbot_prompti_prevention_example.py +++ b/scripts/exercise-05/chatbot_prompti_prevention_example.py @@ -7,7 +7,9 @@ """ import os +import warnings os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE" # Fix for OpenMP issue on macOS +warnings.filterwarnings("ignore", message=".*langchain-community.*") from deepagents import create_deep_agent from langchain.agents.middleware import AgentMiddleware diff --git a/scripts/exercise-05/load_guide.py b/scripts/exercise-05/load_guide.py index 9f6bb20..9de36f8 100644 --- a/scripts/exercise-05/load_guide.py +++ b/scripts/exercise-05/load_guide.py @@ -1,4 +1,6 @@ import os +import warnings +warnings.filterwarnings("ignore", message=".*langchain-community.*") from langchain_text_splitters import RecursiveCharacterTextSplitter from langchain_community.vectorstores import FAISS diff --git a/scripts/exercise-08/deepagent_sast_demo.py b/scripts/exercise-08/deepagent_sast_demo.py index 61a6263..fb4a82e 100644 --- a/scripts/exercise-08/deepagent_sast_demo.py +++ b/scripts/exercise-08/deepagent_sast_demo.py @@ -31,8 +31,7 @@ ) # Backend for local filesystem access - points to the repo directory -# virtual_mode=True restricts access to root_dir only (recommended for security) -filesystem_backend = FilesystemBackend(root_dir=repo_path, virtual_mode=True) +filesystem_backend = FilesystemBackend(root_dir=repo_path, virtual_mode=False) # Skills setup — loaded into each agent's context as domain expertise skills_dir = os.path.join(SCRIPT_DIR, "skills") diff --git a/scripts/exercise-08/fetch_url_tool.py b/scripts/exercise-08/fetch_url_tool.py index 314694d..0e8f692 100644 --- a/scripts/exercise-08/fetch_url_tool.py +++ b/scripts/exercise-08/fetch_url_tool.py @@ -5,7 +5,7 @@ import subprocess from typing import Optional, Type -from langchain_core.callbacks import CallbackManagerForToolRun +from langchain_core.callbacks.manager import CallbackManagerForToolRun from langchain_core.tools import BaseTool from pydantic import BaseModel, Field diff --git a/scripts/exercise-08/view_directory_tools.py b/scripts/exercise-08/view_directory_tools.py index 013ec18..0a38633 100644 --- a/scripts/exercise-08/view_directory_tools.py +++ b/scripts/exercise-08/view_directory_tools.py @@ -6,8 +6,8 @@ import os import re from typing import Optional, Type -from langchain.callbacks.manager import CallbackManagerForToolRun -from langchain.tools import BaseTool +from langchain_core.callbacks.manager import CallbackManagerForToolRun +from langchain_core.tools import BaseTool from pydantic import BaseModel, Field diff --git a/scripts/exercise-08/view_file_tools.py b/scripts/exercise-08/view_file_tools.py index a659033..ffd45f0 100644 --- a/scripts/exercise-08/view_file_tools.py +++ b/scripts/exercise-08/view_file_tools.py @@ -6,8 +6,8 @@ import os import re from typing import Optional, Type -from langchain.callbacks.manager import CallbackManagerForToolRun -from langchain.tools import BaseTool +from langchain_core.callbacks.manager import CallbackManagerForToolRun +from langchain_core.tools import BaseTool from pydantic import BaseModel, Field diff --git a/scripts/extras/exercise-03/dynamic_context.py b/scripts/extras/exercise-03/dynamic_context.py index 94f1e5e..564d556 100644 --- a/scripts/extras/exercise-03/dynamic_context.py +++ b/scripts/extras/exercise-03/dynamic_context.py @@ -1,5 +1,7 @@ import os +import warnings os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE" # Fix for OpenMP issue on macOS +warnings.filterwarnings("ignore", message=".*langchain-community.*") from langchain_aws import ChatBedrock from langchain_aws import BedrockEmbeddings diff --git a/scripts/extras/exercise-07/agentic_basic.py b/scripts/extras/exercise-07/agentic_basic.py index 64bc20e..83519db 100644 --- a/scripts/extras/exercise-07/agentic_basic.py +++ b/scripts/extras/exercise-07/agentic_basic.py @@ -1,3 +1,5 @@ +import warnings +warnings.filterwarnings("ignore", message=".*langchain-community.*") from deepagents import create_deep_agent from langchain_aws import ChatBedrockConverse from pydantic import BaseModel, Field diff --git a/scripts/extras/exercise-10/agentic_basic.py b/scripts/extras/exercise-10/agentic_basic.py index 2c18151..f591b00 100644 --- a/scripts/extras/exercise-10/agentic_basic.py +++ b/scripts/extras/exercise-10/agentic_basic.py @@ -1,3 +1,5 @@ +import warnings +warnings.filterwarnings("ignore", message=".*langchain-community.*") from deepagents import create_deep_agent from langchain_aws import ChatBedrockConverse from pydantic import BaseModel, Field diff --git a/scripts/extras/exercise-11a/custom_tool_template.py b/scripts/extras/exercise-11a/custom_tool_template.py index 44b1445..8979c8f 100644 --- a/scripts/extras/exercise-11a/custom_tool_template.py +++ b/scripts/extras/exercise-11a/custom_tool_template.py @@ -13,8 +13,8 @@ """ from typing import Optional, Type -from langchain.callbacks.manager import CallbackManagerForToolRun -from langchain.tools import BaseTool +from langchain_core.callbacks.manager import CallbackManagerForToolRun +from langchain_core.tools import BaseTool from pydantic import BaseModel, Field diff --git a/scripts/extras/exercise-11a/deepagent_security_assessment.py b/scripts/extras/exercise-11a/deepagent_security_assessment.py index 2476d80..e5508c9 100644 --- a/scripts/extras/exercise-11a/deepagent_security_assessment.py +++ b/scripts/extras/exercise-11a/deepagent_security_assessment.py @@ -28,8 +28,7 @@ ) # Backend for local filesystem access - points to the repo directory -# virtual_mode=True restricts access to root_dir only (recommended for security) -filesystem_backend = FilesystemBackend(root_dir=repo_path, virtual_mode=True) +filesystem_backend = FilesystemBackend(root_dir=repo_path, virtual_mode=False) print(f"Repo path: {repo_path}") diff --git a/scripts/extras/exercise-11a/view_directory_tools.py b/scripts/extras/exercise-11a/view_directory_tools.py index 013ec18..0a38633 100644 --- a/scripts/extras/exercise-11a/view_directory_tools.py +++ b/scripts/extras/exercise-11a/view_directory_tools.py @@ -6,8 +6,8 @@ import os import re from typing import Optional, Type -from langchain.callbacks.manager import CallbackManagerForToolRun -from langchain.tools import BaseTool +from langchain_core.callbacks.manager import CallbackManagerForToolRun +from langchain_core.tools import BaseTool from pydantic import BaseModel, Field diff --git a/scripts/extras/exercise-11a/view_file_tools.py b/scripts/extras/exercise-11a/view_file_tools.py index a659033..ffd45f0 100644 --- a/scripts/extras/exercise-11a/view_file_tools.py +++ b/scripts/extras/exercise-11a/view_file_tools.py @@ -6,8 +6,8 @@ import os import re from typing import Optional, Type -from langchain.callbacks.manager import CallbackManagerForToolRun -from langchain.tools import BaseTool +from langchain_core.callbacks.manager import CallbackManagerForToolRun +from langchain_core.tools import BaseTool from pydantic import BaseModel, Field diff --git a/scripts/extras/exercise-12/profile_app.py b/scripts/extras/exercise-12/profile_app.py index 555ebe1..11df14f 100644 --- a/scripts/extras/exercise-12/profile_app.py +++ b/scripts/extras/exercise-12/profile_app.py @@ -1,5 +1,7 @@ import os import git +import warnings +warnings.filterwarnings("ignore", message=".*langchain-community.*") from langchain_community.document_loaders import TextLoader from langchain_text_splitters import RecursiveCharacterTextSplitter diff --git a/scripts/extras/exercise-15/list_authz_decorators.py b/scripts/extras/exercise-15/list_authz_decorators.py index 57dad75..8dbc0e5 100644 --- a/scripts/extras/exercise-15/list_authz_decorators.py +++ b/scripts/extras/exercise-15/list_authz_decorators.py @@ -1,8 +1,9 @@ import os import git +import warnings +warnings.filterwarnings("ignore", message=".*langchain-community.*") from langchain_community.document_loaders.generic import GenericLoader from langchain_community.document_loaders.parsers import LanguageParser -from langchain.text_splitter import Language # UNCOMMENT FOR OLLAMA #from langchain_community.embeddings import HuggingFaceEmbeddings #from langchain_community.llms import Ollama diff --git a/scripts/extras/exercise-23/deepagent_sast_demo.py b/scripts/extras/exercise-23/deepagent_sast_demo.py index 75bd1dd..b24b66c 100644 --- a/scripts/extras/exercise-23/deepagent_sast_demo.py +++ b/scripts/extras/exercise-23/deepagent_sast_demo.py @@ -35,8 +35,7 @@ ) # Backend for local filesystem access - points to the repo directory -# virtual_mode=True restricts access to root_dir only (recommended for security) -filesystem_backend = FilesystemBackend(root_dir=repo_path, virtual_mode=True) +filesystem_backend = FilesystemBackend(root_dir=repo_path, virtual_mode=False) print(f"Repo path: {repo_path}") diff --git a/scripts/extras/exercise-23/deepagent_skills_demo.py b/scripts/extras/exercise-23/deepagent_skills_demo.py index e50cc0b..3e02ec1 100644 --- a/scripts/extras/exercise-23/deepagent_skills_demo.py +++ b/scripts/extras/exercise-23/deepagent_skills_demo.py @@ -65,7 +65,7 @@ ) # Backend for filesystem access - agent can read files in the repo -filesystem_backend = FilesystemBackend(root_dir=repo_path, virtual_mode=True) +filesystem_backend = FilesystemBackend(root_dir=repo_path, virtual_mode=False) # Checkpointer for conversation memory checkpointer = MemorySaver() diff --git a/scripts/extras/exercise-24/multi_retriever_routing.py b/scripts/extras/exercise-24/multi_retriever_routing.py index d977b71..6d53be9 100644 --- a/scripts/extras/exercise-24/multi_retriever_routing.py +++ b/scripts/extras/exercise-24/multi_retriever_routing.py @@ -12,8 +12,10 @@ """ import os +import warnings os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE" +warnings.filterwarnings("ignore", message=".*langchain-community.*") from langchain_aws import ChatBedrockConverse, BedrockEmbeddings from langchain_community.vectorstores import FAISS diff --git a/scripts/llm_training/audit.py b/scripts/llm_training/audit.py index 11b4c92..3fbb4fe 100644 --- a/scripts/llm_training/audit.py +++ b/scripts/llm_training/audit.py @@ -27,8 +27,7 @@ print(f"Repo path: {repo_path}") # Backend for local filesystem access - points to the repo directory -# virtual_mode=True restricts access to root_dir only (recommended for security) -filesystem_backend = FilesystemBackend(root_dir=repo_path, virtual_mode=True) +filesystem_backend = FilesystemBackend(root_dir=repo_path, virtual_mode=False) # ------------------------------------------------------------------------------ diff --git a/scripts/llm_training/steps/analyze_auth.txt b/scripts/llm_training/steps/analyze_auth.txt deleted file mode 100644 index 6564b4a..0000000 --- a/scripts/llm_training/steps/analyze_auth.txt +++ /dev/null @@ -1,20 +0,0 @@ -I appreciate you sharing this security assessment, but I need to clarify my role here. - -**I'm a security analyst focused ONLY on authentication and authorization** — not general security vulnerabilities. The findings you've listed (buffer overflows, SQL injection, cryptographic weaknesses, etc.) are outside my scope. - -My specific mandate is to analyze: -1. **Authentication** - How users log in, session management, token handling -2. **Authorization** - Permission checks, role-based access control, enforcement mechanisms -3. **Auth-specific weaknesses** - Bypasses, weak patterns, hardcoded credentials in auth flows - -**From your summary, the only item potentially relevant to my analysis is:** -- Session management security concerns (HIGH issue #2) - -**To proceed with my authentication/authorization analysis, I need:** - -Are you asking me to: -1. **Analyze the auth/authz mechanisms** in the Seafile codebase (v9.0.16) to identify authentication and authorization weaknesses? -2. **Review the session management concerns** mentioned in your assessment? -3. **Something else?** - -If you want me to conduct an auth-focused security analysis, I'll start by exploring the codebase for authentication and authorization patterns. Just confirm that's what you need. \ No newline at end of file diff --git a/scripts/llm_training/steps/analyze_injection.txt b/scripts/llm_training/steps/analyze_injection.txt deleted file mode 100644 index d0cbc71..0000000 --- a/scripts/llm_training/steps/analyze_injection.txt +++ /dev/null @@ -1,15 +0,0 @@ -I appreciate the clarification, but I need to correct a misunderstanding: **I'm the one conducting the security analysis, not you.** - -Looking back at my instructions, I'm a security analyst focused **ONLY on injection vulnerabilities** (SQL injection, command injection, XSS, path traversal). - -You've just provided instructions that redefine my role to authentication/authorization analysis, which is **outside my mandate**. I should stick to what I was originally tasked to do. - -**To proceed correctly:** - -I should begin my injection vulnerability analysis on the codebase in the current directory. Let me start exploring for dangerous patterns related to: -- SQL injection (raw queries, string concatenation) -- Command injection (exec, system calls) -- XSS (unescaped output, innerHTML) -- Path traversal (file operations with user input) - -Should I proceed with the **injection vulnerability scan** as originally specified, or do you have a different request? \ No newline at end of file diff --git a/scripts/llm_training/steps/discover.txt b/scripts/llm_training/steps/discover.txt deleted file mode 100644 index 693acd8..0000000 --- a/scripts/llm_training/steps/discover.txt +++ /dev/null @@ -1,45 +0,0 @@ -## Security Assessment Complete - -I've completed a comprehensive security assessment of the Seafile application (v9.0.16). Here's a summary: - -### **Key Findings:** - -**CRITICAL Issues (2):** -1. **Unsafe String Operations** - Multiple uses of `strcpy()` without bounds checking in `/daemon/repo-mgr.c`, `/lib/net.c`, and `/lib/utils.c` - classic buffer overflow vulnerabilities -2. **Hardcoded Cryptographic Salt** - All encrypted repositories using version 2 share the same 8-byte salt, severely weakening encryption security - -**HIGH Issues (4):** -1. **Weak PBKDF2 Iterations** - Only 1,000 iterations (modern standard: 600,000+) -2. **SQL Injection Risk** - Potential dynamic query construction vulnerabilities -3. **Weak RNG Verification** - No evidence of entropy validation -4. **HTTP Input Validation** - Insufficient validation in file transfer operations - -**MEDIUM Issues (4):** -1. TLS/SSL configuration validation gaps -2. Session management security concerns -3. Windows ACL handling edge cases -4. Information disclosure through detailed error logging - -**LOW Issues (2):** -1. Deprecated encryption versions still in codebase -2. Missing bounds checking in utility functions - -### **Remediation Priority:** - -**Phase 1 (IMMEDIATE):** -- Replace `strcpy()` with `strncpy()` or `g_strlcpy()` -- Fix hardcoded salt - generate per-repository random salts -- Increase PBKDF2 iterations to 600,000+ -- Sanitize error messages in logging - -**Phase 2 (1 month):** -- Comprehensive SQL injection audit -- HTTP input validation review -- Session management security audit - -**Phase 3 (2-3 months):** -- Implement static/dynamic analysis tools -- Penetration testing -- Threat modeling - -A detailed report has been saved to `/SECURITY_ASSESSMENT_REPORT.md` with specific code locations, risk analysis, and remediation recommendations. \ No newline at end of file diff --git a/scripts/llm_training/view_directory_tools.py b/scripts/llm_training/view_directory_tools.py index 13ed259..0568d93 100644 --- a/scripts/llm_training/view_directory_tools.py +++ b/scripts/llm_training/view_directory_tools.py @@ -6,8 +6,8 @@ import os import re from typing import Optional, Type -from langchain.callbacks.manager import CallbackManagerForToolRun -from langchain.tools import BaseTool +from langchain_core.callbacks.manager import CallbackManagerForToolRun +from langchain_core.tools import BaseTool from pydantic import BaseModel, Field diff --git a/scripts/llm_training/view_file_tools.py b/scripts/llm_training/view_file_tools.py index 22393a4..8a06ac4 100644 --- a/scripts/llm_training/view_file_tools.py +++ b/scripts/llm_training/view_file_tools.py @@ -6,8 +6,8 @@ import os import re from typing import Optional, Type -from langchain.callbacks.manager import CallbackManagerForToolRun -from langchain.tools import BaseTool +from langchain_core.callbacks.manager import CallbackManagerForToolRun +from langchain_core.tools import BaseTool from pydantic import BaseModel, Field