# Security

## In plain words

**We never store your keys. Your real key never leaves your machine: calls made with a guest’s key are made from your machine, so access pauses when your machine is offline.**

- The real key sits in an encrypted vault on your machine; the vault’s master key is in your OS keychain. LogicPacks servers never receive it.
- A guest’s agent only ever gets a sealed placeholder, never the key.
- When the guest’s agent calls the API, their lp sends the request, with a ticket signed by the registry, through a tunnel to your machine. Your machine checks the ticket, the grant, the allowed hosts and the rate limit, adds the key, calls the provider and scrubs the key out of the response.
- So calls made with a guest’s key are made from your machine, and access pauses while your machine is offline. For a contributor in another time zone, run the key host on an always-on Mac or Linux machine of yours. You can revoke a grant at once.
- Your machine writes one line per guest call to `~/.logicpacks/keyd.log` (key, guest, host, status). A call log you can browse per person is on the roadmap.
- The rate limit is per key and shared by all its guests. There is no spend cap yet: pair LogicPacks with a provider-side key that has its own spending limit.
- For a key you share, the registry keeps only its name, its rules and a masked hint (a few characters from each end, like sk-…243) so you can tell keys apart.

## Try it safely

Test it before you hand a real key to anyone.

1. **Use a spare key with a spending limit.** Create a new key at your provider just for this, with a low hard cap set in the provider's dashboard. LogicPacks limits requests per minute; it does not cap spend.
2. **Store it with one allowed host and a rate.** `lp key add TEST_KEY --hosts api.openai.com --rate 10` (the value is read from a hidden prompt).
3. **Share it for a short time.** `lp share TEST_KEY @teammate --ttl 1d`, then `lp host up` on your machine. Use a second account of your own if you have no teammate yet.
4. **Check the key stays hidden.** On the guest side, ask the agent to print its environment and the request headers: it should see only `lp_sealed_…`. A call to a host you did not allow should not get the key.
5. **Check usage matches.** Compare the provider's usage page with the guest calls your machine logged (one line per call in `~/.logicpacks/keyd.log`: key, guest, host, status).
6. **Revoke and confirm.** `lp revoke TEST_KEY --from teammate`; the next call from the guest fails. Then delete the spare key at the provider.

## The details

What lp promises: a key VALUE is never in a command line, a log, the registry, a ticket, git, or a markdown file.

- **Vault.** Values are encrypted on disk (`~/.logicpacks/vault.bin`: HKDF-SHA256 keys, HMAC-SHA256 keystream, encrypt-then-MAC).
  The master key is in the OS keychain (macOS Keychain, Windows DPAPI, libsecret on Linux; a 0600 file only when none exists).
  `keys.json` holds names, masked hints, hosts and packs only.
- **Input.** `lp key add` reads from a hidden prompt or stdin, never from arguments.
- **Use.** Programs get `lp_sealed_*` placeholders. LogicPacks keys (127.0.0.1 only) swaps them only for hosts the key allows, and only for
  sessions that `lp run` opened; responses are scrubbed (raw, URL-encoded and base64 forms). Control calls need a secret kept in a
  0600 file under `~/.logicpacks`.
- **Scanning.** `lp scan` (and the pre-commit hook, `lp push`, `lp pack lint`) refuse secret-looking values. The registry scans every
  request body and query with the same rules and answers 422 on a hit. Values are shown masked (`sk-…f3Q`).
- **Identity.** `lp login` makes an Ed25519 key per machine (sealed in the vault); every registry request is signed
  (method, path, time, body hash; 5 minute window). Reviews and key invites are signed with it too.
- **Teammates.** A shared key is used through the owner's LogicPacks keys service only. The registry issues signed tickets (15 minutes at most); the
  owner's LogicPacks keys service checks signature, expiry, revocations, its own grant record, hosts, packs and rate before injecting.
  Revoke, unshare and `lp key kill` take effect on the next request.
- **Registry.** Stores handles, public keys, space/pack metadata, pack files you push (secret-scanned), invites, grants and
  masked key metadata. Never values. Logs hold method, path, status and time only.
- **Known limits.** `--inject` exposes real values to the child process (logged and flagged). A teammate's request content is
  visible to the owner's LogicPacks keys service while it is forwarded. Anyone with your OS account can use your keys through LogicPacks keys.

## Roadmap (not built yet)

- Allow or block specific endpoints per person (today: per host).
- Block specific queries.
- A call log you can view per person (today: local log lines on your machine).
- Changing the rules by asking your agent.
- The github.com to logicpacks.io converter, with mock endpoints and demo data.

## Why trust it

**We never store your keys. Your real key never leaves your machine: calls made with a guest’s key are made from your machine, so access pauses when your machine is offline.**

Your agent should not follow instructions from a stranger. TechRealm takes responsibility for what is listed.

1. **Honest levels, with evidence:** A space is public only after a secret scan and lint pass. Levels L0 to L4 show how far each pack is proven, with its evidence; today the public packs sit at their machine level (L1 executed, L2 checks passed 3 of 3 runs). L3 (human-verified) needs a signed approval by a reviewer on the LogicPacks team list (api.logicpacks.io/v1/reviewers); anyone else's approval shows as a community approval.
2. **Checked and signed:** The installer checks each release against its SHA-256. Registry requests, reviews and key invites are signed with an Ed25519 key per machine.
3. **Your yes before a first run:** The first run of a pack someone else wrote needs your yes, enforced by lp, not by the agent. On a Mac it is a click in a system dialog; no setting or environment variable turns that into a prompt an agent could answer. On Linux or over ssh you type RUN in your terminal. No flag skips it, each new version asks again, with nobody to ask lp refuses, and your OKs are signed with a key from your vault so a hand-written entry does not count. A pack gets only the key names it declares, injected by your local proxy; the agent never sees the values. Limits: a program running as you with full access to your account, including your vault, can forge anything stored on that account; on Linux, a program driving a pseudo-terminal can type the answer.
4. **No instructions from this site:** setup.md is a short guide for the person installing; it gives agents no instructions. What your agent does comes from a skill on your own machine, which you can read or delete. The protocol is open (Apache-2.0).
5. **Disclosure, review, revocation:** Report a problem to security@logicpacks.io or privately on GitHub (Tech-Realm/pack-protocol). A TechRealm reviewer checks it, and a bad pack or key can be revoked at once.

- **What we keep.** Your @handle and your machines' public keys; the packs and spaces you push and their metadata; invites, grants and masked key details (name, rules, a short hint). We keep these until you delete them or ask us to delete your @handle. Request logs hold only method, path, status and time, for a short time to run the service. Usage counts store one hashed address per pack per day, never the address itself.
- **What we never keep.** Key values and environment values. Not in the registry, a log, a ticket or a file we hold.
- **Who can see shared code.** Private by default. A private space or pack is visible only to the @handles you share it with, after they accept, and you can take it back at any time. Nothing is public until you publish it and it passes review.
- **Reporting a problem.** Write to security@logicpacks.io (also in /.well-known/security.txt). We confirm we got it, fix it, and tell you when it is done.
- **Audits.** No third-party security audit yet. The code paths that handle keys are described in /security.md.

Report a problem: security@logicpacks.io (see https://logicpacks.io/.well-known/security.txt).


---

Canonical URL: https://logicpacks.io/security.md

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
