> ## Documentation Index
> Fetch the complete documentation index at: https://docs.khanhng.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 5.2 Credentials and Access Control

> How sign-in, sessions, and permissions work in Kcode Robot Suite today, and their limits.

## 5.2.1 Sign-in

The login server action calls `DemoAuthService.signIn`. The default validator accepts only the username `admin` with the password `admin`. These credentials are a development-only demo account and must not be used for production access.

## 5.2.2 Session cookie

| Attribute | Value |
| - | - |
| Name | `kcode-demo-session` |
| Value | The constant `demo-admin` |
| `httpOnly` | `true` |
| `sameSite` | `lax` |
| `secure` | `true` when `NODE_ENV` is `production` |
| `path` | `/` |
| Lifetime | Session cookie, or seven days when **Remember me** is selected |

The middleware protects `/launcher` and `/demo/:path*` by comparing the cookie to the constant value.

> [!CAUTION]
>
> The cookie value is a fixed string, not a secret. Any client that sets `kcode-demo-session=demo-admin` is treated as signed in. Do not expose this application to untrusted users.

## 5.2.3 Permissions

| Layer | Behavior |
| - | - |
| Kernel `PermissionService` | Stores grants per subject. `platform.admin` passes every check. Not wired into the web app. |
| `DemoAuthService.hasPermission` | True for `platform.admin` or an exact match. |
| Web app `PlatformProvider` | Returns the user `demo-admin` with `platform.admin`, and `hasPermission` always returns `true`. |

Plugins declare `requiredPermissions` on routes and commands, but the demo runtime does not enforce them.

## 5.2.4 Credential handling

| Rule | Detail |
| - | - |
| No secrets in source control | Provider-specific credentials stay out of the repository. |
| Service interfaces | New integrations receive configuration through a service interface. |
| Release automation | Workflows use the default `GITHUB_TOKEN` with the permissions declared in each workflow. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.