mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-01 21:20:33 +00:00
fix: python.lang.security.audit.eval-detected.eval-detected-python-helpers-memory.py (#444)
Co-authored-by: Harshit-65 <kira@offgridsec.com>
This commit is contained in:
parent
490f469ca7
commit
de39128e7d
1 changed files with 2 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import ast
|
||||
from datetime import datetime
|
||||
from typing import Any, List, Sequence
|
||||
from langchain.storage import InMemoryByteStore, LocalFileStore
|
||||
|
|
@ -391,7 +392,7 @@ class Memory:
|
|||
def _get_comparator(condition: str):
|
||||
def comparator(data: dict[str, Any]):
|
||||
try:
|
||||
return eval(condition, {}, data)
|
||||
return ast.literal_eval(condition, {}, data)
|
||||
except Exception as e:
|
||||
# PrintStyle.error(f"Error evaluating condition: {e}")
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue