@@ -61,7 +61,7 @@ async def create_tool_response(
6161 created_at, expires_at, metadata)
6262 VALUES (:id, :session_key, :tool_name, :original_content, :content_type,
6363 :created_at, :expires_at, :metadata)
64- """
64+ """ # nosec B608 - TABLE_NAME is a code-controlled constant, not user input
6565
6666 params = {
6767 "id" : response_id ,
@@ -119,7 +119,7 @@ async def get_tool_response(
119119 created_at, expires_at, metadata
120120 FROM { self .TABLE_NAME }
121121 WHERE id = :id
122- """
122+ """ # nosec B608 - TABLE_NAME is a code-controlled constant, not user input
123123
124124 results = await self .db .execute_query (query , {"id" : response_id }, conn = conn )
125125
@@ -168,7 +168,7 @@ async def get_responses_by_session(
168168 FROM { self .TABLE_NAME }
169169 WHERE session_key = :session_key AND expires_at > :now
170170 ORDER BY created_at DESC
171- """
171+ """ # nosec B608 - TABLE_NAME is a code-controlled constant, not user input
172172
173173 results = await self .db .execute_query (
174174 query , {"session_key" : session_key , "now" : now }, conn = conn
@@ -206,14 +206,14 @@ async def cleanup_expired(
206206 # First count how many will be deleted
207207 count_query = f"""
208208 SELECT COUNT(*) FROM { self .TABLE_NAME } WHERE expires_at <= :now
209- """
209+ """ # nosec B608 - TABLE_NAME is a code-controlled constant, not user input
210210 result = await self .db .execute_query (count_query , {"now" : now }, conn = conn )
211211 count = result [0 ][0 ] if result else 0
212212
213213 # Then delete
214214 delete_query = f"""
215215 DELETE FROM { self .TABLE_NAME } WHERE expires_at <= :now
216- """
216+ """ # nosec B608 - TABLE_NAME is a code-controlled constant, not user input
217217 await self .db .execute_non_query (delete_query , {"now" : now }, conn = conn )
218218
219219 if count > 0 :
@@ -227,5 +227,5 @@ async def _delete_response(
227227 conn : AsyncConnection | None = None ,
228228 ) -> None :
229229 """Delete a single response by ID."""
230- query = f"DELETE FROM { self .TABLE_NAME } WHERE id = :id"
230+ query = f"DELETE FROM { self .TABLE_NAME } WHERE id = :id" # nosec B608
231231 await self .db .execute_non_query (query , {"id" : response_id }, conn = conn )
0 commit comments