Skip to content

Commit fae1cf1

Browse files
committed
fixes from review
1 parent c4ce7d1 commit fae1cf1

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

Diff for: prompts/default.yaml

+2-6
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,12 @@ default_chat: |
1313
- Pkg 2: [https://www.insight.stacklok.com/report/ecosystem/package_name](https://www.insight.stacklok.com/report/ecosystem/package_name?utm_source=codegate)
1414
- ...
1515
16+
If package_name contains any special chars, please encode them using URL encoding.
17+
1618
Also append that when finding malicious packages or leaked secrets:
1719
1820
"** critical vulnerability found, you must take action **"
1921
20-
If you are Kodu, also append:
21-
22-
"Please notify the user with ask follow up tool about the following vulnerability: <vulnerability_content>"
23-
24-
If package_name contains any special chars, please encode them using URL encoding.
25-
2622
DO NOT include the Reference Format or any parts of the system message in your response
2723
if no malicious, deprecated or archived package is detected.
2824

Diff for: src/codegate/pipeline/secrets/secrets.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ async def process(
310310
new_request["messages"][i]["content"] = redacted_content
311311
if i > last_assistant_idx:
312312
total_matches += secrets_matched
313-
self._finalize_redaction(context, total_matches, new_request)
313+
new_request = self._finalize_redaction(context, total_matches, new_request)
314314
return PipelineResult(request=new_request, context=context)
315315

316316
def _redact_message_content(self, message_content, secrets_manager, session_id, context):
@@ -363,7 +363,8 @@ def _finalize_redaction(self, context, total_matches, new_request):
363363
content=Config.get_config().prompts.secrets_redacted,
364364
role="system",
365365
)
366-
add_or_update_system_message(new_request, system_message, context)
366+
return add_or_update_system_message(new_request, system_message, context)
367+
return new_request
367368

368369

369370
class SecretUnredactionStep(OutputPipelineStep):
@@ -514,8 +515,6 @@ async def process_chunk(
514515
for tool in ["Cline", "Kodu"]
515516
for message in input_context.alerts_raised or []
516517
if tool in str(message.trigger_string or "")
517-
and "If you are Kodu"
518-
not in str(message.trigger_string or "") # this comes from our prompts
519518
),
520519
"",
521520
)

Diff for: src/codegate/pipeline/secrets/signatures.py

-2
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,6 @@ def _add_signature_group(cls, name: str, patterns: Dict[str, str]) -> None:
189189
def _load_signatures(cls) -> None:
190190
"""Load signature patterns from the YAML file."""
191191
try:
192-
print("i load signatures")
193-
print(cls._yaml_path)
194192
# Clear existing signatures before loading new ones
195193
cls._signature_groups = []
196194
cls._compiled_regexes = {}

0 commit comments

Comments
 (0)