Skip to content

Commit 2bea181

Browse files
committed
Merge remote-tracking branch 'origin/200-total-score-is-zero-when-partial-score-is-not' into 232-add-tap-attack
2 parents fc0c1b3 + 3ab9e54 commit 2bea181

457 files changed

Lines changed: 10927 additions & 3694 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,75 @@
1+
## v0.5.0 (2026-02-17)
2+
3+
### ✨ Features
4+
5+
- **FlipAttack**: The FlipAttack technique was introduced.
6+
- **FlipAttack**: The FlipAttack technique was introduced. It is also tested in the test folder
7+
8+
### 🐛🚑️ Fixes
9+
10+
- the error on the JSON serialization with the OpenAI SDK is fixed
11+
12+
### ♻️ Refactorings
13+
14+
- **generator-and-judge**: We add the RAG within our demo
15+
- **generator-and-judge**: We add the RAG within our demo
16+
- **Refactoring-attacks**: refactoring attacks code with folders for evaluator and generator
17+
18+
### build
19+
20+
- **deps**: bump urllib3 from 2.5.0 to 2.6.3
21+
- **deps**: bump urllib3 from 2.5.0 to 2.6.3
22+
23+
### bump
24+
25+
- **deps**: bump litellm from 1.81.8 to 1.81.12
26+
- **deps-dev**: bump ruff from 0.15.0 to 0.15.1
27+
- **deps**: bump openai from 2.17.0 to 2.21.0
28+
- **deps**: bump textual from 7.5.0 to 8.0.0
29+
- **deps-dev**: bump commitizen from 4.13.5 to 4.13.7
30+
- **deps-dev**: bump openapi-python-client from 0.28.1 to 0.28.2
31+
- **deps-dev**: bump google-adk from 1.24.1 to 1.25.0
32+
- **deps-dev**: bump ruff from 0.14.14 to 0.15.0
33+
- **deps**: bump rich from 14.3.1 to 14.3.2
34+
- **deps**: bump litellm from 1.81.5 to 1.81.8
35+
- **deps-dev**: bump google-adk from 1.24.0 to 1.24.1
36+
- **deps-dev**: bump mcp from 1.25.0 to 1.26.0
37+
- **deps-dev**: bump google-adk from 1.23.0 to 1.24.0
38+
- **deps**: bump openai from 2.16.0 to 2.17.0
39+
- **deps-dev**: bump commitizen from 4.12.1 to 4.13.5
40+
- **deps**: bump litellm from 1.81.1 to 1.81.5
41+
- **deps**: bump textual from 7.4.0 to 7.5.0
42+
- **deps**: bump openai from 2.15.0 to 2.16.0
43+
- **deps**: bump rich from 14.2.0 to 14.3.1
44+
- **deps**: bump textual from 7.3.0 to 7.4.0
45+
46+
### fix
47+
48+
- **tests**: fix JSON serialization issue
49+
- **tests**: fix JSON serialization issue
50+
51+
### style
52+
53+
- apply ruff formatting
54+
55+
### ✅🤡🧪 Tests
56+
57+
- In examples\langchain\rag there is a test using an AdvPrefix attack with a RAG use case, using a custom LangChain-based endpoint with OpenAI interfaces
58+
- In examples\langchain\rag there is a test showing an advprefix attack in a RAG scenario using a custom endpoint with LangChain based on OpenAI interfaces
59+
60+
### 📝💡 Documentation
61+
62+
- **Risks-profile**: Adding risk profiles within the documentation
63+
- **Risks**: Adding risks and related vulnerabilities with profiles
64+
65+
### 🔥⚰️ Clean up
66+
67+
- removed test rag lmstudio script
68+
69+
### 🫥 fixup
70+
71+
- reformatted attack py
72+
173
## v0.4.4 (2026-01-27)
274

375
### 🐛🚑️ Fixes

docs/docs/agents/google-adk.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ slug: /agents/google-adk
77

88
Google Agent Development Kit (ADK) is a framework for building conversational AI agents with tool-calling capabilities. HackAgent provides native support for testing ADK-based agents.
99

10-
## 🔧 Setup
10+
## Setup
1111

1212
### Prerequisites
1313

@@ -46,7 +46,7 @@ Google Agent Development Kit (ADK) is a framework for building conversational AI
4646
pip install hackagent
4747
```
4848

49-
## 🚀 Basic Integration
49+
## Basic Integration
5050

5151
### Initialize HackAgent Client
5252

@@ -71,7 +71,7 @@ The SDK automatically handles ADK-specific features:
7171
- **Response Parsing**: Extraction of agent responses and metadata
7272
- **Error Handling**: ADK-specific error scenarios
7373

74-
## ⚔️ Running Security Tests
74+
## Running Security Tests
7575

7676
### Basic AdvPrefix Attack
7777

@@ -141,7 +141,7 @@ def test_adk_security():
141141
agent.hack(attack_config=attack_config)
142142
```
143143

144-
## 🔍 ADK-Specific Security Concerns
144+
## ADK-Specific Security Concerns
145145

146146
### Tool Hijacking
147147

@@ -180,7 +180,7 @@ multi_turn_goals = [
180180
]
181181
```
182182

183-
## 🛠️ Advanced Configuration
183+
## Advanced Configuration
184184

185185
### Custom ADK Adapter Settings
186186

@@ -217,7 +217,7 @@ The SDK automatically handles ADK sessions:
217217
3. **Request Routing**: Routes requests to proper session endpoints
218218
4. **Session Cleanup**: Handles session termination
219219

220-
## 🔒 Security Best Practices
220+
## Security Best Practices
221221

222222
### ADK Agent Hardening
223223

@@ -235,7 +235,7 @@ The SDK automatically handles ADK sessions:
235235
4. **Regular Assessment**: Run security tests regularly
236236
5. **Responsible Disclosure**: Report vulnerabilities responsibly
237237

238-
## 🐛 Troubleshooting
238+
## Troubleshooting
239239

240240
### Common Issues
241241

@@ -291,7 +291,7 @@ agent = HackAgent(
291291
)
292292
```
293293

294-
## 📊 Results and Reporting
294+
## Results and Reporting
295295

296296
### Viewing Results
297297

@@ -323,7 +323,7 @@ attack_config = {
323323
2. **[Attack Tutorial](../getting-started/attack-tutorial.md)** - Getting started with attacks
324324
3. **[Security Guidelines](../security/responsible-disclosure.md)** - Responsible disclosure practices
325325

326-
## 📞 Support
326+
## Support
327327

328328
- **ADK Documentation**: [Google ADK Docs](https://google.github.io/adk-docs/)
329329
- **HackAgent Issues**: [GitHub Issues](https://github.com/AISecurityLab/hackagent/issues)

docs/docs/agents/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ agent.hack(attack_config=attack_config)
9191
</TabItem>
9292
</Tabs>
9393

94-
👉 [Full Ollama Documentation](/agents/ollama)
94+
[Full Ollama Documentation](/agents/ollama)
9595

9696
</TabItem>
9797
<TabItem value="openai" label={<span><img src="https://openai.com/favicon.ico" alt="OpenAI" style={{height: '24px', marginRight: '8px', verticalAlign: 'middle'}} />OpenAI SDK</span>}>
@@ -168,7 +168,7 @@ agent.hack(attack_config=attack_config)
168168
</TabItem>
169169
</Tabs>
170170

171-
👉 [Full OpenAI SDK Documentation](/agents/openai-sdk)
171+
[Full OpenAI SDK Documentation](/agents/openai-sdk)
172172

173173
</TabItem>
174174
<TabItem value="google-adk" label={<span><img src="https://google.github.io/adk-docs/assets/agent-development-kit.png" alt="Google ADK" style={{height: '24px', marginRight: '8px', verticalAlign: 'middle'}} />Google ADK</span>}>
@@ -249,7 +249,7 @@ agent.hack(attack_config=attack_config)
249249
</TabItem>
250250
</Tabs>
251251

252-
👉 [Full Google ADK Documentation](/agents/google-adk)
252+
[Full Google ADK Documentation](/agents/google-adk)
253253

254254
</TabItem>
255255
</Tabs>

docs/docs/agents/ollama.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import ThemedImage from '@theme/ThemedImage';
99

1010
Ollama is a lightweight framework for running large language models locally. HackAgent provides native support for testing agents running on Ollama, allowing you to assess the security of self-hosted LLMs.
1111

12-
## 🔧 Setup
12+
## Setup
1313

1414
### Prerequisites
1515

@@ -39,7 +39,7 @@ Ollama is a lightweight framework for running large language models locally. Hac
3939
# Should return JSON with your installed models
4040
```
4141

42-
## 🚀 Basic Usage
42+
## Basic Usage
4343

4444
### Initialize HackAgent Client
4545

@@ -63,7 +63,7 @@ The adapter supports all Ollama features:
6363
- **Chat & Generate APIs**: Both `/api/chat` and `/api/generate` endpoints
6464
- **Model Discovery**: Automatic listing of available models
6565

66-
## ⚔️ Running Security Tests
66+
## Running Security Tests
6767

6868
### Basic AdvPrefix Attack
6969

@@ -158,7 +158,7 @@ attack_config = {
158158
}
159159
```
160160

161-
## 🔍 Available Models
161+
## Available Models
162162

163163
To see which models you have installed:
164164

@@ -172,7 +172,7 @@ Popular models for security testing:
172172
- `codellama` - Code-focused Llama variant
173173
- `llama2-uncensored` - Uncensored Llama 2 (useful for attack generation)
174174

175-
## 🛠️ Troubleshooting
175+
## Troubleshooting
176176

177177
### Connection Refused
178178

@@ -222,7 +222,7 @@ agent = HackAgent(
222222
)
223223
```
224224

225-
## 📚 Further Reading
225+
## Further Reading
226226

227227
- [Ollama Documentation](https://ollama.ai)
228228
- [Ollama Model Library](https://ollama.ai/library)

docs/docs/agents/openai-sdk.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ slug: /agents/openai-sdk
77

88
OpenAI SDK is the official Python library for interacting with OpenAI's API, including GPT-4, GPT-3.5, and other models. HackAgent provides native support for testing agents built with the OpenAI SDK, including those using function calling and tool use.
99

10-
## 🔧 Setup
10+
## Setup
1111

1212
### Prerequisites
1313

@@ -38,7 +38,7 @@ OpenAI SDK is the official Python library for interacting with OpenAI's API, inc
3838
export OPENAI_API_BASE="https://your-resource.openai.azure.com"
3939
```
4040

41-
## 🚀 Basic Integration
41+
## Basic Integration
4242

4343
### Initialize HackAgent Client
4444

@@ -65,7 +65,7 @@ The adapter supports all OpenAI SDK features:
6565
- **Custom Endpoints**: Azure OpenAI, local models, etc.
6666
- **Message History**: Multi-turn conversation testing
6767

68-
## ⚔️ Running Security Tests
68+
## Running Security Tests
6969

7070
### Basic AdvPrefix Attack
7171

@@ -128,7 +128,7 @@ for agent_name in agents:
128128
print(f"Results for {agent_name}: {results}")
129129
```
130130

131-
## 🌐 Azure OpenAI Integration
131+
## Azure OpenAI Integration
132132

133133
HackAgent supports Azure OpenAI Service out of the box:
134134

@@ -142,7 +142,7 @@ agent = HackAgent(
142142

143143
**Note:** Make sure your `AZURE_OPENAI_API_KEY` environment variable is set. The adapter will use your Azure endpoint configuration.
144144

145-
## 📊 Understanding Results
145+
## Understanding Results
146146

147147
After running tests, check your HackAgent dashboard for:
148148

@@ -151,7 +151,7 @@ After running tests, check your HackAgent dashboard for:
151151
3. **Token Usage**: API cost analysis
152152
4. **Response Patterns**: Common vulnerabilities across models
153153

154-
## 🛡️ Best Practices
154+
## Best Practices
155155

156156
### Rate Limiting
157157
```python
@@ -184,7 +184,7 @@ export OPENAI_API_KEY_TEST="sk-test-..."
184184
export OPENAI_API_KEY_PROD="sk-prod-..."
185185
```
186186

187-
## 🐛 Troubleshooting
187+
## Troubleshooting
188188

189189
### "OpenAI SDK is not installed"
190190
```bash
@@ -215,14 +215,14 @@ except Exception as e:
215215
# Check dashboard for partial results
216216
```
217217

218-
## 📚 Additional Resources
218+
## Additional Resources
219219

220220
- [OpenAI API Documentation](https://platform.openai.com/docs)
221221
- [OpenAI SDK GitHub](https://github.com/openai/openai-python)
222222
- [HackAgent Attack Tutorial](../getting-started/attack-tutorial.md)
223223
- [Function Calling Guide](https://platform.openai.com/docs/guides/function-calling)
224224

225-
## 🔄 Next Steps
225+
## Next Steps
226226

227227
1. Review results on your [HackAgent Dashboard](https://app.hackagent.dev)
228228
2. Try different models and configurations

docs/docs/api-index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This section provides detailed documentation for all classes, methods, and funct
1717

1818
This documentation covers the **Python SDK API** - the classes and methods you use when writing Python code with HackAgent. If you're looking for information about raw HTTP endpoints, those are accessed through the SDK and not documented separately at this time.
1919

20-
For practical usage examples and getting started guides, see the [Attack Tutorial](./getting-started/attack-tutorial.md).
20+
For practical usage examples and getting started guides, see the [Python SDK Quickstart](./sdk/python-quickstart.md).
2121

2222
---
2323

0 commit comments

Comments
 (0)