Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(backend): prevent logging sensitive data in SafeJson fallback (#12547)

Zamil Majdye79928a815b6
diff --git a/autogpt_platform/backend/backend/util/json.py b/autogpt_platform/backend/backend/util/json.py
index d0d3a3121e..c89df8ce86 100644
--- a/autogpt_platform/backend/backend/util/json.py
+++ b/autogpt_platform/backend/backend/util/json.py
@@ -165,11 +165,10 @@ def sanitize_json(data: Any) -> Any:
# Log the failure and fall back to string representation
logger.error(
"SafeJson fallback to string representation due to serialization error: %s (%s). "
- "Data type: %s, Data preview: %s",
+ "Data type: %s",
type(e).__name__,
truncate(str(e), 200),
type(data).__name__,
- truncate(str(data), 100),
)
# Ultimate fallback: convert to string representation and sanitize