Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]

### Fixed

- `zeph-tools`: scrape executor now redacts sensitive query parameters (tokens, API keys) from URLs
before writing them to audit JSONL via `redact_url_for_log`. Previously, raw URLs were passed
directly to `log_audit` and `run_with_audit` in both the legacy fenced-block `execute()` path and
the structured `execute_tool_call` path. Closes #4713.
- `zeph-tools`: `apply_ipi_filter` tracing span now correctly covers the `filter_async().await` call
using `#[tracing::instrument]`. Previously a manual `span.enter()` was called after the await
point, making the IPI filtering invisible in traces. Closes #4712.

### Added

- `zeph-skills`: recursive `SKILL.md` discovery now uses depth-first pre-order traversal
Expand Down
11 changes: 5 additions & 6 deletions crates/zeph-tools/src/scrape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ impl ToolExecutor for WebScrapeExecutor {
Ok(output) => {
self.log_audit(
"web_scrape",
&instruction.url,
&redact_url_for_log(&instruction.url),
AuditResult::Success,
duration_ms,
None,
Expand All @@ -296,7 +296,7 @@ impl ToolExecutor for WebScrapeExecutor {
let audit_result = tool_error_to_audit_result(&e);
self.log_audit(
"web_scrape",
&instruction.url,
&redact_url_for_log(&instruction.url),
audit_result,
duration_ms,
Some(&e),
Expand Down Expand Up @@ -347,7 +347,7 @@ impl ToolExecutor for WebScrapeExecutor {
self.run_with_audit(
"web_scrape",
"web-scrape",
&instruction.url,
&redact_url_for_log(&instruction.url),
call.caller_id.clone(),
call.skill_name.clone(),
correlation_id,
Expand All @@ -373,7 +373,7 @@ impl ToolExecutor for WebScrapeExecutor {
self.run_with_audit(
"fetch",
"fetch",
&p.url,
&redact_url_for_log(&p.url),
call.caller_id.clone(),
call.skill_name.clone(),
correlation_id,
Expand Down Expand Up @@ -1007,14 +1007,13 @@ impl WebScrapeExecutor {
/// # Errors
///
/// Returns a [`ToolError`] if the blocking scan task panics.
#[tracing::instrument(name = "tools.scrape.apply_ipi_filter", skip(self, body), fields(body_len = body.len()))]
async fn apply_ipi_filter(&self, body: &str, url: &str) -> Result<String, ToolError> {
let span = tracing::info_span!("tools.scrape.apply_ipi_filter", url, body_len = body.len());
let verdict = self
.ipi_filter
.filter_async(body.to_owned())
.await
.map_err(|e| ToolError::Execution(std::io::Error::other(e.to_string())))?;
let _enter = span.enter();
if !verdict.patterns_found.is_empty() {
tracing::warn!(
url = url,
Expand Down
Loading