feat(tools): python_action — stateless Python execution with proxy helpers
Restores the legacy persistent-IPython tool's *ergonomics* (proxy helpers pre-bound, structured stdout/stderr/error returns) without the in-container daemon: each call ships ``strix.tools.proxy._calls`` source into ``/tmp`` alongside a per-call driver, runs ``python3 -u`` against it, and parses a sentinel-delimited JSON payload back from stdout. The driver fetches its own guest token from Caido at ``localhost:48080`` and binds ``list_requests`` / ``view_request`` / ``send_request`` / ``repeat_request`` / ``scope_rules`` to that client; user code runs inside an ``async def`` wrapper so top-level ``await`` works. The proxy SDK call sequences live in one file — ``strix/tools/proxy/_calls.py`` — and are reused by both the host-side ``@function_tool`` wrappers (which add JSON serialization for the LLM) and the in-container kernel (which exposes the bare async functions). No code duplication; the helper logic itself is host-shipped, so tweaking the proxy helpers does not require an image rebuild. Image: a single ``pip install caido-sdk-client`` line so the driver's ``import caido_sdk_client`` resolves. Skill ``tooling/python`` is always-loaded alongside ``tooling/agent_browser``. Trade-off accepted: state does not persist across calls (no kernel). For multi-step workflows the agent combines into one ``code`` block or writes a script to ``/workspace/scratch/`` and runs via ``exec_command``. If a workflow surfaces that genuinely needs persistence, the same tool surface migrates to a kernel-backed executor without changing the LLM contract. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -77,6 +77,13 @@ RUN pipx install arjun && \
|
||||
pipx inject dirsearch setuptools && \
|
||||
pipx install wafw00f
|
||||
|
||||
# ``python_action`` ships a fresh ``caido-sdk-client`` per call into /tmp.
|
||||
# Install it system-wide so the driver's ``import caido_sdk_client`` resolves
|
||||
# without venv activation. The helper *logic* lives host-side in
|
||||
# ``strix/tools/proxy/_calls.py`` (shipped at runtime) — only the SDK dep
|
||||
# is image-baked.
|
||||
RUN pip install --break-system-packages --no-cache-dir caido-sdk-client
|
||||
|
||||
ENV NPM_CONFIG_PREFIX=/home/pentester/.npm-global
|
||||
RUN mkdir -p /home/pentester/.npm-global
|
||||
|
||||
|
||||
Reference in New Issue
Block a user