Sanitize logs, code, and secrets before sending to LLMs.
Project description
LogShield CLI
Sanitize logs, code, and text before sending them to LLMs.
LogShield automatically detects and redacts sensitive data — API keys, emails, phone numbers, credit cards, passwords, and more — so you can safely use AI tools without leaking secrets.
What it detects
- API keys (AWS, OpenAI, GitHub, Stripe, Slack, and more)
- Emails, phone numbers, credit card numbers (Luhn-validated)
- Passwords and secrets in environment variables
- JWT tokens, Bearer tokens, private keys
- Named entities: people and organizations (English + Italian)
- Public IP addresses
Private IPs (192.168.x.x, 10.x.x.x) and known test/demo emails are ignored.
Installation
pip install logshield
Requires Python 3.10+.
Setup
Get your API key from RapidAPI and run:
logshield
On first launch, use /setkey to save your API key.
Usage
Interactive TUI
logshield
Paste any text, press Enter — get back the sanitized version with a list of what was detected.
Pipe mode
cat app.log | logshield pipe
Reads from stdin, writes sanitized output to stdout. Exits non-zero if quota is exceeded.
Check quota
logshield quota
Example
Input:
User mario.rossi@company.it connected from 8.8.8.8
AWS key: AKIAIOSFODNN7EXAMPLE
password=hunter2
Output:
User [REDACTED:email] connected from [REDACTED:ip]
AWS key: [REDACTED:aws_key]
[REDACTED:env_secret]
Privacy
Your text is sent to the LogShield API over HTTPS and processed in memory. No input text is stored or logged. Only anonymous usage counters (call count, character count) are recorded for quota tracking.
Disclaimer: LogShield is a privacy-assistance tool. While it uses advanced algorithms (Luhn validation, NER, regex patterns), it does not guarantee 100% detection of all sensitive data. The user remains solely responsible for any data sent to third parties. No liability is accepted for undetected sensitive information.
Pricing
Available on RapidAPI — free tier included.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file logshield-0.1.0.tar.gz.
File metadata
- Download URL: logshield-0.1.0.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
829df0be9832b7756e6ebc2a3faed3c6d7ae1dfffc4207132561b3a766b6e2a6
|
|
| MD5 |
1ffd7bea19344e9a7d9aa520237e27b4
|
|
| BLAKE2b-256 |
111bc043e2ee40ccfe0f949ec54597701b1fe4cc98f29c24df94342ca2207f10
|
File details
Details for the file logshield-0.1.0-py3-none-any.whl.
File metadata
- Download URL: logshield-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d4217bc0260201cbe893187df558ccddc59a874411429d72a93856ee908aec3
|
|
| MD5 |
f5210569e118aa5644dc8d880bc6f697
|
|
| BLAKE2b-256 |
a3192ffbc2696d8aa9deaa64026f59dcc3e5a695cad982b4dba7e3f4be0e4f59
|