Quickstart
Try Verdict locally in 5 minutes without setting up external infrastructure or modifying application code.
In this walkthrough you will:
- Install the Verdict CLI
- Start a local Verdict Server
- Write, validate, and publish a
.vdpolicy - Insert facts and run authorization checks
- Extend the policy to support document sharing
1. Install the CLI
Section titled “1. Install the CLI”You need Node.js 24 or newer for this walkthrough.
Install the CLI with the shell installer:
curl -fsSL https://useverdict.dev/install.sh | shOr install it with your JavaScript package manager:
npm i -g @useverdict/cliConfirm that the CLI is available and create a working directory:
verdict --helpmkdir verdict-quickstartcd verdict-quickstart2. Start the server
Section titled “2. Start the server”Start a local Verdict Server in your terminal:
verdict serveThis starts Verdict Server on localhost:4891 and creates ./verdict.db to persist your policy and facts. Keep this terminal running for the rest of the guide.
3. Write and publish a policy
Section titled “3. Write and publish a policy”Create policy.vd in the same directory:
declare is_owner(User, Document);
allow(user: User, "read", document: Document) if is_owner(user, document);Open a second terminal in verdict-quickstart, then validate and publish the policy:
verdict validate policy.vdverdict policy publish --local policy.vd4. Add a fact
Section titled “4. Add a fact”Add an ownership fact to the local server:
verdict fact add --local 'is_owner(User:alice, Document:handbook)'5. Perform an authorization check
Section titled “5. Perform an authorization check”Check whether User:alice and User:bob can "read" Document:handbook:
verdict authorize --local User:alice read Document:handbook# Allowed
verdict authorize --local User:bob read Document:handbook# Denied6. Add a new access path
Section titled “6. Add a new access path”To let users share documents, add a shared_to fact declaration and allow rule to policy.vd:
declare is_owner(User, Document);declare shared_to(Document, User);
allow(user: User, "read", document: Document) if is_owner(user, document);
allow(user: User, "read", document: Document) if shared_to(document, user);Republish the updated policy, add a shared_to fact for User:bob, and re-run the check:
verdict policy publish --local policy.vdverdict fact add --local 'shared_to(Document:handbook, User:bob)'verdict authorize --local User:bob read Document:handbook# AllowedCleanup
Section titled “Cleanup”Stop the server in the first terminal with Ctrl+C and remove the verdict-quickstart directory when you are finished.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Check |
|---|---|
| Connection failure | Keep the server terminal running and use port 4891 |
| Port already in use | Stop the process using 4891 before starting this walkthrough |
Next steps
Section titled “Next steps”- Learn the building blocks of
.vdpolicies in Policy Fundamentals. - Connect your backend to Verdict Server in Integrate with Verdict Server.
- Explore all CLI commands in the CLI reference.