Desktop app (local program)
Note for AI agents: This page is baseline guidance, not an exact prescription. Read it, tell your owner what applies to their project, and get their approval before you change anything. Your project's own rules take precedence. If something important for this project is missing here, suggest it to your owner.
For agents
- A desktop app runs with the user’s rights on their machine. Typical class: M (L for sensitive data or large audiences).
- Rule 1: sign builds (and notarize on macOS) and ship signed updates over HTTPS.
- Rule 2: sandbox the interface layer and validate every message to the privileged layer.
- Rule 3: keep secrets in the operating system store and say where user data lives.
Which class?
- S: a small offline utility with no data of value.
- M: accounts, personal data, or a server-side API key.
- L: sensitive data, enterprise users, many installs.
- XL: a very large installed base.
Audit checklist
Every project
- Facts are verified from current official documentation
- What: Commands, libraries, APIs and platform policies in the project come from current official documents, not from memory.
- How to check: Open the dependency list and the platform configuration; for each non-trivial choice find the official page it relies on (link in a comment or a decision note).
- Evidence: Decision note or code comment with the official URL and the date it was checked.
- Packages come from official sources, stable versions only
- What: Packages and versions are chosen from official sources; the current stable release is used, not alpha or beta.
- How to check: Read the dependency file for pre-release tags (alpha, beta, rc, next); check each package on its official registry page.
- Evidence: Dependency file without pre-release versions.
- No secrets in code, chat, commits or logs
- What: Passwords, keys and tokens live in environment variables or a secret manager;
.envis ignored by git; the repository has only.env.example. - How to check: Check
.gitignorefor.env; run a secret scanner (for example gitleaks) over the full history; search for key-like strings. - Evidence:
.gitignoreline, scanner report with zero findings,.env.examplepath.
- What: Passwords, keys and tokens live in environment variables or a secret manager;
- Reports separate “written”, “tested” and “works end to end”
- What: Status reports say clearly whether something is written, passed its tests, or was run end to end; skipped or failed steps are stated.
- How to check: Read the last HANDOFF or release notes; look for features reported as done that have no test or run record.
- Evidence: HANDOFF lines or a test log for each feature marked done.
- Project memory files exist and are current
- What: The repository has CLAUDE.md or AGENTS.md (permanent rules) and HANDOFF.md (where we stopped), updated at the end of every work round.
- How to check: Look in the repository root for both files; compare the HANDOFF date with the latest commit date.
- Evidence: File paths and the date of the last HANDOFF update.
- Builds are code-signed (and notarized on macOS)
- What: Installers and binaries are signed with the publisher’s certificate; macOS apps are notarized.
- How to check: Check the release pipeline for signing steps; verify the signature of a built file.
- Evidence: Signature verification output.
- Local user data has a documented location and removal path
- What: The app stores user data in a known folder, says so, and removes it on uninstall or on request.
- How to check: Find the data path; run install, use, uninstall and check leftovers.
- Evidence: Data path note; uninstall test.
+ If it has users, personal data or API keys (M)
- One package manager, lockfile committed
- What: Exactly one package manager is used and enforced; the lockfile is committed; installs are done from the lockfile (for example
--frozen-lockfile). - How to check: Look for a lockfile in the repository and a rule that forbids other managers; check the CI and Docker install commands.
- Evidence: Lockfile path; install command lines.
- What: Exactly one package manager is used and enforced; the lockfile is committed; installs are done from the lockfile (for example
- Updates are signed and delivered over HTTPS
- What: The auto-update mechanism verifies signatures and uses HTTPS; a failed update does not break the installed version.
- How to check: Read the updater configuration; test an update with a modified package.
- Evidence: Config lines; rejected-package test.
- The UI layer is sandboxed (Electron-style apps)
- What: Context isolation and sandboxing are on, Node integration is off in pages that load content, and navigation to outside addresses is blocked or opened in the browser.
- How to check: Read the window creation settings (
contextIsolation,sandbox,nodeIntegration) and navigation handlers. - Evidence: Settings lines.
- Messages between UI and system layer are validated
- What: Every message from the UI to the privileged layer is validated and exposes only narrow, named functions.
- How to check: Read the preload/IPC handlers for input checks and a small exposed surface.
- Evidence: Handler code with validation.
- Local secrets use the operating system store
- What: Tokens and passwords are kept in the OS credential store, not in plain files.
- How to check: Search for where tokens are saved; inspect the app data folder.
- Evidence: Storage code; folder inspection.
- External API keys stay on the server
- What: Third-party API keys (including LLM keys) are kept on the server and never shipped to the browser or app.
- How to check: Search the client bundle and app package for key-like strings; check that client calls go to your own server.
- Evidence: Search result with zero keys in the client build.
- All input is validated on the server with a schema
- What: Every request body, query and parameter is checked on the server against a schema; the client check is only a convenience.
- How to check: For each endpoint find the schema or validator; send invalid, oversized and unexpected fields and see the response.
- Evidence: Validator files per endpoint; test cases for invalid input.
- Critical flows have automated tests and a local check
- What: Login, saving data, payment (if any) and permission checks have automated tests; one local command runs the checks before pushing.
- How to check: List the test files; run the check command; look for a git hook that runs it.
- Evidence: Test names and a passing run log.
- Open source licenses are shown
- What: A published app or site shows the name and license of each library (for example Settings → Open source licenses), generated from the lockfile; forbidden licenses fail a check.
- How to check: Find the licenses screen or file and how it is generated; look for a license check in CI.
- Evidence: Generated license list; CI step.
- Personal data fields are documented
- What: For every personal data field the purpose, retention time and legal basis (KVKK, GDPR) are written down.
- How to check: List the database columns and form fields with personal data; find the matching entries in the data note.
- Evidence: Data note listing each field with purpose, period and basis.
- Accessibility basics meet WCAG 2.2 AA
- What: Correct heading order, text alternatives, enough contrast, keyboard navigation, visible focus, sufficient touch targets, and respect for reduced-motion settings.
- How to check: Tab through every screen; run an automated checker (for example axe) and a contrast check; test with a screen reader once; check
prefers-reduced-motionhandling. - Evidence: Checker report, list of screens tried with keyboard and screen reader.
- Logs contain no personal data or secrets
- What: Logs do not record passwords, tokens, keys or personal data; if needed they are masked.
- How to check: Read the logging setup; trigger a login and a form and inspect the log lines; search for e-mail and token patterns.
- Evidence: Sample log lines after a test run showing masking.
+ If it has an admin panel, file uploads, many users or a store app (L)
Items for class L: see Desktop app: classes L–XL checklist.
+ If it targets millions of users (XL)
Items for class XL: see Desktop app: classes L–XL checklist.
Common mistakes
- Shipping unsigned installers that browsers and systems warn about.
- Auto-update over plain HTTP or without checking signatures.
- Node access enabled in a window that loads remote content.
- Tokens stored in a plain settings file.
- Loading remote web pages inside the app without limiting navigation.
- No way to remove local data on uninstall.
- Opening links from content inside the privileged window.
- Forgetting that the app runs with the user’s full file rights.
Example projects
- Note-taking app built with Electron: desktop app, M.
- Offline unit converter: desktop app, S.
- Accounting program with local database: desktop app, L, financial data.
- Screen recorder: desktop app, M.
- Backup client: desktop app, L.
- Game launcher: desktop app, M.
- Markdown editor: desktop app, S.
- Company VPN client: desktop app, L.
- Password manager desktop app: desktop app, L, sensitive data.
- Developer tool with a window: desktop app, M.
- Photo editor: desktop app, M.
- Hospital kiosk software: desktop app, L.
Sources
- Electron: Security — Electron
- Electron: Process Sandboxing — Electron
- Electron: Context Isolation — Electron
- Electron: Code Signing — Electron
- Electron: Updating Applications — Electron
- Notarizing macOS software before distribution — Apple Developer
- App Sandbox — Apple Developer
- Secrets Management Cheat Sheet — OWASP Cheat Sheet Series
- Cryptographic Storage Cheat Sheet — OWASP Cheat Sheet Series
- Concise Guide for Developing More Secure Software — OpenSSF
- Pro Build Guide v1.2: compiled team practices — Pro Build Guide