You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: address security issues in documentation examples
- Replace hardcoded API key placeholders with env var references in config.yaml examples (part9)
- Standardize placeholder keys to use obvious non-secret patterns (<your-key-here>)
- Add security warning for unauthenticated LightRAG REST API (bind to 127.0.0.1)
- Add proper cryptographic secret generation for Telegram webhook secret
- Add chmod 600 guidance for .env files containing API keys
- Add curl-pipe-to-bash inspection tip for install command
- Replace realistic-looking Telegram bot token examples with safe placeholders
Co-Authored-By: Rob <onerobby@gmail.com>
>**Windows users:** Native Windows is not supported. Install [WSL2](https://learn.microsoft.com/en-us/windows/wsl/install) and run the command from inside WSL. It works perfectly.
113
120
114
121
### What the Installer Does
@@ -185,8 +192,11 @@ This opens an interactive menu to add API keys for each provider. Keys are store
> **Security tip:** Set restrictive permissions on this file: `chmod 600 ~/.hermes/lightrag/.env`
647
+
636
648
### Entity Extraction Model — What to Use
637
649
638
650
This is the LLM that reads your documents and pulls out entities and relationships during ingestion. Quality here directly determines how good your knowledge graph is.
@@ -658,15 +670,17 @@ This is the LLM that reads your documents and pulls out entities and relationshi
658
670
```bash
659
671
cd~/.hermes/lightrag/LightRAG
660
672
661
-
# Start the API server
662
-
lightrag-server --port 9623
673
+
# Start the API server (binds to localhost by default)
674
+
lightrag-server --host 127.0.0.1 --port 9623
663
675
```
664
676
665
677
The server starts on `http://localhost:9623` with:
666
678
-**REST API** for ingestion and querying
667
679
-**Web UI** at `http://localhost:9623/webui` for browsing the knowledge graph
668
680
-**Health check** at `http://localhost:9623/health`
669
681
682
+
> **Security warning:** The LightRAG REST API has **no built-in authentication**. Always bind to `127.0.0.1` (localhost only) — never `0.0.0.0`. If you need remote access, put it behind a reverse proxy (nginx, Caddy) with authentication, or use SSH tunneling. Anyone who can reach this port can query, ingest, or delete your knowledge graph data.
683
+
670
684
### Run as a Background Service
671
685
672
686
```bash
@@ -1088,8 +1102,8 @@ Select **Telegram** when prompted. The wizard asks for your bot token and allowe
Generate a strong secret — never use a guessable value:
1194
+
1195
+
```bash
1196
+
openssl rand -hex 32
1197
+
```
1198
+
1199
+
Copy the output and paste it as your `TELEGRAM_WEBHOOK_SECRET` value.
1200
+
1201
+
> **Warning:** A weak or default webhook secret lets attackers forge Telegram webhook requests and inject messages into your agent. Always use a cryptographically random value.
>**Windows users:** Native Windows is not supported. Install [WSL2](https://learn.microsoft.com/en-us/windows/wsl/install) and run the command from inside WSL. It works perfectly.
18
25
19
26
### What the Installer Does
@@ -74,8 +81,11 @@ This opens an interactive menu to add API keys for each provider. Keys are store
> **Security tip:** Set restrictive permissions on this file: `chmod 600 ~/.hermes/lightrag/.env`
88
+
87
89
> **Tip:** Use `gpt-4.1-mini` or `claude-sonnet-4-20250514` for entity extraction. It doesn't need to be your smartest model — it just needs to reliably identify entities and relationships. Cheaper models save money on ingestion.
88
90
89
91
> **Embedding quality matters.** If you have a GPU with 8GB+ VRAM, run `nomic-embed-text` locally via Ollama for free. If you want the best quality, use Fireworks' Qwen3-Embedding-8B (4096 dimensions) — the search accuracy difference is dramatic.
@@ -97,15 +99,17 @@ EMBEDDING_API_KEY=fw_...
97
99
```bash
98
100
cd~/.hermes/lightrag/LightRAG
99
101
100
-
# Start the API server
101
-
lightrag-server --port 9623
102
+
# Start the API server (binds to localhost by default)
103
+
lightrag-server --host 127.0.0.1 --port 9623
102
104
```
103
105
104
106
The server starts on `http://localhost:9623` with:
105
107
-**REST API** for ingestion and querying
106
108
-**Web UI** at `http://localhost:9623/webui` for browsing the knowledge graph
107
109
-**Health check** at `http://localhost:9623/health`
108
110
111
+
> **Security warning:** The LightRAG REST API has **no built-in authentication**. Always bind to `127.0.0.1` (localhost only) — never `0.0.0.0`. If you need remote access, put it behind a reverse proxy (nginx, Caddy) with authentication, or use SSH tunneling. Anyone who can reach this port can query, ingest, or delete your knowledge graph data.
Generate a strong secret — never use a guessable value:
203
+
204
+
```bash
205
+
openssl rand -hex 32
206
+
```
207
+
208
+
Copy the output and paste it as your `TELEGRAM_WEBHOOK_SECRET` value.
209
+
210
+
> **Warning:** A weak or default webhook secret lets attackers forge Telegram webhook requests and inject messages into your agent. Always use a cryptographically random value.
Copy file name to clipboardExpand all lines: part9-custom-models.md
+16-7Lines changed: 16 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,8 @@
8
8
9
9
Models are configured in `~/.hermes/config.yaml`:
10
10
11
+
> **Security note:** Never put real API keys directly in `config.yaml`. Use environment variable references so keys stay in `~/.hermes/.env` (which should be `chmod 600` and never committed to git).
12
+
11
13
```yaml
12
14
# Default model
13
15
model: claude-sonnet-4-20250514
@@ -16,22 +18,22 @@ provider: anthropic
16
18
# Provider configurations
17
19
providers:
18
20
anthropic:
19
-
api_key: sk-ant-...
21
+
api_key: ${ANTHROPIC_API_KEY}
20
22
21
23
openai:
22
-
api_key: sk-...
24
+
api_key: ${OPENAI_API_KEY}
23
25
24
26
cerebras:
25
-
api_key: csk-...
27
+
api_key: ${CEREBRAS_API_KEY}
26
28
base_url: https://api.cerebras.ai/v1
27
29
28
30
fireworks:
29
-
api_key: fw_...
31
+
api_key: ${FIREWORKS_API_KEY}
30
32
base_url: https://api.fireworks.ai/inference/v1
31
33
32
34
local:
33
35
base_url: http://localhost:11434/v1
34
-
api_key: ollama
36
+
api_key: ollama# Ollama doesn't require a real key
35
37
```
36
38
37
39
## Adding a Custom Provider
@@ -41,10 +43,17 @@ Any provider that implements the OpenAI chat completions API works:
0 commit comments