Merge branch 'main' of github.com:danielmiessler/fabric
This commit is contained in:
commit
d7657829ed
52
README.md
52
README.md
@ -93,15 +93,15 @@ One of <code>fabric</code>'s primary features is helping people collect and inte
|
||||
|
||||
Fabric has Patterns for all sorts of life and work activities, including:
|
||||
|
||||
- Extracting the most interesting parts of YouTube videos and podcasts
|
||||
- Writing an essay in your own voice with just an idea as an input
|
||||
- Summarizing opaque academic papers
|
||||
- Creating perfectly matched AI art prompts for a piece of writing
|
||||
- Rating the quality of content to see if you want to read/watch the whole thing
|
||||
- Getting summaries of long, boring content
|
||||
- Explaining code to you
|
||||
- Turning bad documentation into usable documentation
|
||||
- Creating social media posts from any content input
|
||||
- Extracting the most interesting parts of YouTube videos and podcasts.
|
||||
- Writing an essay in your own voice with just an idea as an input.
|
||||
- Summarizing opaque academic papers.
|
||||
- Creating perfectly matched AI art prompts for a piece of writing.
|
||||
- Rating the quality of content to see if you want to read/watch the whole thing.
|
||||
- Getting summaries of long, boring content.
|
||||
- Explaining code to you.
|
||||
- Turning bad documentation into usable documentation.
|
||||
- Creating social media posts from any content input.
|
||||
- And a million more…
|
||||
|
||||
### Our approach to prompting
|
||||
@ -110,7 +110,7 @@ Fabric _Patterns_ are different than most prompts you'll see.
|
||||
|
||||
- **First, we use `Markdown` to help ensure maximum readability and editability**. This not only helps the creator make a good one, but also anyone who wants to deeply understand what it does. _Importantly, this also includes the AI you're sending it to!_
|
||||
|
||||
Here's an example of a Fabric Pattern.
|
||||
Here's an example of a Fabric Pattern
|
||||
|
||||
```bash
|
||||
https://github.com/danielmiessler/fabric/blob/main/patterns/extract_wisdom/system.md
|
||||
@ -127,11 +127,11 @@ https://github.com/danielmiessler/fabric/blob/main/patterns/extract_wisdom/syste
|
||||
The most feature-rich way to use Fabric is to use the `fabric` client, which can be found under <a href="https://github.com/danielmiessler/fabric/tree/main/installer/client">`/client`</a> directory in this repository.
|
||||
|
||||
### Required Python Version
|
||||
Ensure you have at least python3.10 installed on you operating system. Otherwise, when you attempt to run the pip install commands, the project will fail to build due to certain dependencies.
|
||||
Ensure you have at least python3.10 installed on your operating system. Otherwise, when you attempt to run the pip install commands, the project will fail to build due to certain dependencies.
|
||||
|
||||
### Setting up the fabric commands
|
||||
|
||||
Follow these steps to get all fabric related apps installed and configured.
|
||||
Follow these steps to get all fabric-related apps installed and configured.
|
||||
|
||||
1. Navigate to where you want the Fabric project to live on your system in a semi-permanent place on your computer.
|
||||
|
||||
@ -147,7 +147,7 @@ cd /where/you/keep/code
|
||||
git clone https://github.com/danielmiessler/fabric.git
|
||||
```
|
||||
|
||||
3. Enter Fabric's main directory
|
||||
3. Enter Fabric's main directory.
|
||||
|
||||
```bash
|
||||
# Enter the project folder (where you cloned it)
|
||||
@ -172,7 +172,7 @@ Windows:
|
||||
|
||||
Use WSL and follow the Linux instructions.
|
||||
|
||||
5. Install fabric
|
||||
5. Install fabric:
|
||||
|
||||
```bash
|
||||
pipx install .
|
||||
@ -198,16 +198,16 @@ fabric --help
|
||||
|
||||
### Using the `fabric` client
|
||||
|
||||
If you want to use it with OpenAI API compatible inference servers, such as [FastChat](https://github.com/lm-sys/FastChat), [Helmholtz Blablador](http://helmholtz-blablador.fz-juelich.de), [LM Studio](https://lmstudio.ai) and others, simply export the following environment variables:
|
||||
If you want to use it with OpenAI API-compatible inference servers, such as [FastChat](https://github.com/lm-sys/FastChat), [Helmholtz Blablador](http://helmholtz-blablador.fz-juelich.de), [LM Studio](https://lmstudio.ai) and others, simply export the following environment variables:
|
||||
|
||||
- `export OPENAI_BASE_URL=https://YOUR-SERVER:8000/v1/`
|
||||
- `export DEFAULT_MODEL="YOUR_MODEL"`
|
||||
|
||||
And if your server needs authentication tokens, like Blablador does, you export the token the same way you would with OpenAI:
|
||||
And if your server needs authentication tokens, as Blablador does, you export the token the same way you would with OpenAI:
|
||||
|
||||
- `export OPENAI_API_KEY="YOUR TOKEN"`
|
||||
|
||||
Once you have it all set up, here's how to use it.
|
||||
Once you have it all set up, here's how to use it:
|
||||
|
||||
1. Check out the options
|
||||
`fabric -h`
|
||||
@ -218,7 +218,7 @@ usage: fabric [-h] [--text TEXT] [--copy] [--agents] [--output [OUTPUT]] [--sess
|
||||
[--presence_penalty PRESENCE_PENALTY] [--update] [--pattern PATTERN] [--setup] [--changeDefaultModel CHANGEDEFAULTMODEL] [--model MODEL] [--listmodels]
|
||||
[--remoteOllamaServer REMOTEOLLAMASERVER] [--context]
|
||||
|
||||
An open source framework for augmenting humans using AI.
|
||||
An open-source framework for augmenting humans using AI.
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
@ -232,13 +232,13 @@ options:
|
||||
--gui Use the GUI (Node and npm need to be installed)
|
||||
--stream, -s Use this option if you want to see the results in realtime. NOTE: You will not be able to pipe the output into another command.
|
||||
--list, -l List available patterns
|
||||
--temp TEMP set the temperature for the model. Default is 0
|
||||
--temp TEMP sets the temperature for the model. Default is 0
|
||||
--top_p TOP_P set the top_p for the model. Default is 1
|
||||
--frequency_penalty FREQUENCY_PENALTY
|
||||
set the frequency penalty for the model. Default is 0.1
|
||||
sets the frequency penalty for the model. Default is 0.1
|
||||
--presence_penalty PRESENCE_PENALTY
|
||||
set the presence penalty for the model. Default is 0.1
|
||||
--update, -u Update patterns. NOTE: This will revert the default model to gpt4-turbo. please run --changeDefaultModel to once again set default model
|
||||
sets the presence penalty for the model. Default is 0.1
|
||||
--update, -u Update patterns. NOTE: This will revert the default model to gpt4-turbo. please run --changeDefaultModel to once again set the default model
|
||||
--pattern PATTERN, -p PATTERN
|
||||
The pattern (prompt) to use
|
||||
--setup Set up your fabric instance
|
||||
@ -248,7 +248,7 @@ options:
|
||||
Select the model to use
|
||||
--listmodels List all available models
|
||||
--remoteOllamaServer REMOTEOLLAMASERVER
|
||||
The URL of the remote ollamaserver to use. ONLY USE THIS if you are using a local ollama server in an non-default location or port
|
||||
The URL of the remote ollamaserver to use. ONLY USE THIS if you are using a local ollama server in a non-default location or port
|
||||
--context, -c Use Context file (context.md) to add context to your pattern
|
||||
```
|
||||
|
||||
@ -324,7 +324,7 @@ One of the coolest parts of the project is that it's **command-line native**!
|
||||
|
||||
Each Pattern you see in the `/patterns` directory can be used in any AI application you use, but you can also set up your own server using the `/server` code and then call APIs directly!
|
||||
|
||||
Once you're set up, you can do things like:
|
||||
Once you're set-up, you can do things like:
|
||||
|
||||
```bash
|
||||
# Take any idea from `stdin` and send it to the `/write_essay` API!
|
||||
@ -423,7 +423,7 @@ The content features a conversation between two individuals discussing various t
|
||||
|
||||
1. "You can't necessarily think yourself into the answers. You have to create space for the answers to come to you."
|
||||
2. "The West is dying and we are killing her."
|
||||
3. "The American Dream has been replaced by mass packaged mediocrity porn, encouraging us to revel like happy pigs in our own meekness."
|
||||
3. "The American Dream has been replaced by mass-packaged mediocrity porn, encouraging us to revel like happy pigs in our own meekness."
|
||||
4. "There's just not that many people who have the courage to reach beyond consensus and go explore new ideas."
|
||||
5. "I'll start watching Netflix when I've read the whole of human history."
|
||||
6. "Rilke saw beauty in everything... He sees it's in one little thing, a representation of all things that are beautiful."
|
||||
@ -481,7 +481,7 @@ One possible place to store them is `~/.config/custom-fabric-patterns`.
|
||||
Then when you want to use them, simply copy them into `~/.config/fabric/patterns`.
|
||||
|
||||
```bash
|
||||
cp -a ~/.config/custom-fabric-patterns/* ~/.config/fabric/patterns/`
|
||||
cp -a ~/.config/custom-fabric-patterns/* ~/.config/fabric/patterns/
|
||||
```
|
||||
|
||||
Now you can run them with:
|
||||
|
43
patterns/create_pattern/system.md
Normal file
43
patterns/create_pattern/system.md
Normal file
@ -0,0 +1,43 @@
|
||||
# IDENTITY and PURPOSE
|
||||
|
||||
You are an AI assistant whose primary responsibility is to interpret LLM/AI prompts and deliver responses based on pre-defined structures. You are a master of organization, meticulously analyzing each prompt to identify the specific instructions and any provided examples. You then utilize this knowledge to generate an output that precisely matches the requested structure. You are adept at understanding and following formatting instructions, ensuring that your responses are always accurate and perfectly aligned with the intended outcome.
|
||||
|
||||
Take a step back and think step-by-step about how to achieve the best possible results by following the steps below.
|
||||
|
||||
# STEPS
|
||||
|
||||
- Extract a summary of the role the AI will be taking to fulfil this pattern into a section called IDENTITY and PURPOSE.
|
||||
|
||||
- Extract a step by step set of instructions the AI will need to follow in order to complete this pattern into a section called STEPS.
|
||||
|
||||
- Analyze the prompt to determine what format the output should be in.
|
||||
|
||||
- Extract any specific instructions for how the output should be formatted into a section called OUTPUT INSTRUCTIONS.
|
||||
|
||||
- Extract any examples from the prompt into a subsection of OUTPUT INSTRUCTIONS called EXAMPLE.
|
||||
|
||||
# OUTPUT INSTRUCTIONS
|
||||
|
||||
- Only output Markdown.
|
||||
|
||||
- All sections should be Heading level 1
|
||||
|
||||
- Subsections should be one Heading level higher than it's parent section
|
||||
|
||||
- All bullets should have their own paragraph
|
||||
|
||||
- Write the IDENTITY and PURPOSE section including the summary of the role using personal pronouns such as 'You'. Be sure to be extremely detailed in explaining the role. Finalize this section with a new paragraph advising the AI to 'Take a step back and think step-by-step about how to achieve the best possible results by following the steps below.'.
|
||||
|
||||
- Write the STEPS bullets from the prompt
|
||||
|
||||
- Write the OUTPUT INSTRUCTIONS bullets starting with the first bullet explaining the only output format. If no specific output was able to be determined from analyzing the prompt then the output should be markdown. There should be a final bullet of 'Ensure you follow ALL these instructions when creating your output.'. Outside of these two specific bullets in this section, any other bullets must have been extracted from the prompt.
|
||||
|
||||
- If an example was provided write the EXAMPLE subsection under the parent section of OUTPUT INSTRUCTIONS.
|
||||
|
||||
- Write a final INPUT section with just the value 'INPUT:' inside it.
|
||||
|
||||
- Ensure you follow ALL these instructions when creating your output.
|
||||
|
||||
# INPUT
|
||||
|
||||
INPUT:
|
@ -1,10 +1,10 @@
|
||||
# IDENTITY and PURPOSE
|
||||
|
||||
You are an expert in risk and threat management and cybersecurity. You specialize in creating threat models using STRIDE per component methodology for web applications, microservices and cloud.
|
||||
You are an expert in risk and threat management and cybersecurity. You specialize in creating threat models using STRIDE per element methodology for any system.
|
||||
|
||||
# GOAL
|
||||
|
||||
Given a design document of system that someone is concerned about, provide a threat model using STRIDE per component methodology.
|
||||
Given a design document of system that someone is concerned about, provide a threat model using STRIDE per element methodology.
|
||||
|
||||
# STEPS
|
||||
|
||||
@ -14,11 +14,15 @@ Given a design document of system that someone is concerned about, provide a thr
|
||||
|
||||
- Create a virtual whiteboard in you mind and map out all the important concepts, points, ideas, facts, and other information contained in the input.
|
||||
|
||||
- Fully understand the STRIDE per component threat modeling approach.
|
||||
- Fully understand the STRIDE per element threat modeling approach.
|
||||
|
||||
- Take the input provided and create a section called THREAT MODEL, and under that section: table with STRIDE per component threats. Prioritize threats by likelihood and potential impact.
|
||||
- Take the input provided and create a section called ASSETS, determine what data or assets need protection.
|
||||
|
||||
- Threats table should include all components in scope. Components can appear many times as there are many threats valid for one component. For one component there are possible multiply threats.
|
||||
- Under that, create a section called TRUST BOUNDARIES, identify and list all trust boundaries. Trust boundaries represent the border between trusted and untrusted elements.
|
||||
|
||||
- Under that, create a section called DATA FLOWS, identify and list all data flows between components. Data flow is interaction between two components. Mark data flows crossing trust boundaries.
|
||||
|
||||
- Under that, create a section called THREAT MODEL. Create threats table with STRIDE per element threats. Prioritize threats by likelihood and potential impact.
|
||||
|
||||
- Under that, create a section called QUESTIONS & ASSUMPTIONS, list questions that you have and the default assumptions regarding THREAT MODEL.
|
||||
|
||||
@ -34,7 +38,7 @@ Given a design document of system that someone is concerned about, provide a thr
|
||||
|
||||
THREAT ID - id of threat, example: 0001, 0002
|
||||
COMPONENT NAME - name of component in system that threat is about, example: Service A, API Gateway, Sales Database, Microservice C
|
||||
THREAT NAME - name of threat that is based on STRIDE per component methodology and important for component. Be detailed and specific. Examples:
|
||||
THREAT NAME - name of threat that is based on STRIDE per element methodology and important for component. Be detailed and specific. Examples:
|
||||
|
||||
- The attacker could try to get access to the secret of a particular client in order to replay its refresh tokens and authorization "codes"
|
||||
- Credentials exposed in environment variables and command-line arguments
|
||||
|
@ -8,7 +8,7 @@ Take a deep breath and think step by step about how to achieve the best result p
|
||||
|
||||
1. You extract the all the top business ideas from the content. It might be a few or it might be up to 40 in a section called EXTRACTED_IDEAS
|
||||
|
||||
2. Then you pick the best 10 ideas and elaborate on them by pivoting into an adjacent idea. This will be ELABORATED_IDEAS. They should each by unique and have an interesting differentiator.
|
||||
2. Then you pick the best 10 ideas and elaborate on them by pivoting into an adjacent idea. This will be ELABORATED_IDEAS. They should each be unique and have an interesting differentiator.
|
||||
|
||||
## OUTPUT INSTRUCTIONS
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user