Best practices for writing Assistant Memories
This page covers various best practices for writing Assistant memories.
Voice and tone
When writing your memories, aim to "talk" to Assistant the way that you would talk to a new security intern:
- Present and describe the information clearly.
- Describe technical concepts as simply as possible.
- Explain the consequences and outcomes of actions in detail.
The following are two examples of well-written memories:
When generating remediation for SQL injection issues, ensure that the SQL is compatible with BigQuery.
Data from Foo internal services, such as Bar and FooBar, are trusted sources for data flowing into the URL. These findings are false positives.
Purpose
Before beginning, decide what the purpose of the memory is: triage, remediation, or both.
If the purpose of the memory is to influence triage, you can provide a natural language description of the expected consequence:
This repository is a QA repository. All findings can be safely ignored due to these mitigating factors.
If the goal is to influence Assistant's remediation guidance, you can provide a natural language description of the recommendation:
As a standard, leverage the
Jsoup.clean()function to sanitize input.
Once you've decided on the purpose, this informs how you explain your expectations and desired outcomes to Assistant.
Structure
When writing a memory, be sure to include as many of the following components as necessary:
- The conditions that Assistant should be looking for in the codebase, as well as any context Assistant should consider when analyzing your codebase
- Guidance as to how Assistant identifies the conditions that you specified
- The implications for triage and remediation if Assistant identifies that the conditions you specify are present in your codebase
Example #1
Dockerfiles with image
fooare designed to run as a non-root user and are an acceptable risk. All relevant findings are false positives.
In the preceding memory, you can see all three components present:
- Condition and context: Dockerfiles with image
fooare designed to run as non-root user. - Guidance: Look for Dockerfiles with image
foo. - Implication: This is an acceptable risk, so the findings are flagged as false positives.