Skip to content

Commit ef79862

Browse files
Potential fix for code scanning alert no. 49: Clear-text logging of sensitive information (#3573)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 5c6cf4f commit ef79862

File tree

1 file changed

+3
-3
lines changed
  • python/packages/declarative/agent_framework_declarative

1 file changed

+3
-3
lines changed

python/packages/declarative/agent_framework_declarative/_models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def _try_powerfx_eval(value: str | None, log_value: bool = True) -> str | None:
3939
4040
Args:
4141
value: The value to check.
42-
log_value: Whether to log the full value on error or just a snippet.
42+
log_value: Whether to log additional context on error.
4343
"""
4444
if value is None:
4545
return value
@@ -59,9 +59,9 @@ def _try_powerfx_eval(value: str | None, log_value: bool = True) -> str | None:
5959
return engine.eval(value[1:], symbols={"Env": dict(os.environ)})
6060
except Exception as exc:
6161
if log_value:
62-
logger.debug(f"PowerFx evaluation failed for value '{value}': {exc}")
62+
logger.debug("PowerFx evaluation failed for a value: %s", exc)
6363
else:
64-
logger.debug(f"PowerFx evaluation failed for value (first five characters shown) '{value[:5]}': {exc}")
64+
logger.debug("PowerFx evaluation failed for a value (details redacted): %s", exc)
6565
return value
6666

6767

0 commit comments

Comments
 (0)