mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-13 00:15:05 +00:00
Security enhancement: pinned all runtime deps, verify checksums
Extended documentation of ls_specific_settings and of our security approach
This commit is contained in:
1 parent
c6250aeeab
commit
f00a992e5d
40 files changed
+1724
-614
No files matched your search
@@ -226,16 +226,10 @@ ls_specific_settings:
|
||||
# language-server-specific keys
|
||||
```
|
||||
|
||||
:::{attention}
|
||||
Most settings are currently undocumented. Please refer to the
|
||||
[source code of the respective language server](https://github.com/oraios/serena/tree/main/src/solidlsp/language_servers)
|
||||
implementation to determine supported settings.
|
||||
:::
|
||||
|
||||
(override-ls-path)=
|
||||
#### Overriding the Language Server Path
|
||||
|
||||
Some language servers, particularly those that use a single core path for the language server (e.g. the main executable),
|
||||
Most of Serena's language servers, particularly those that use a single core path for the language server (e.g. the main executable),
|
||||
support overriding that path via the `ls_path` setting.
|
||||
Therefore, if you have installed the language server yourself and want to use your installation
|
||||
instead of Serena's managed installation, you can set the `ls_path` setting as follows:
|
||||
@@ -246,9 +240,87 @@ ls_specific_settings:
|
||||
ls_path: "/path/to/language-server"
|
||||
```
|
||||
|
||||
This is supported by all language servers deriving their dependency provider from `LanguageServerDependencyProviderSinglePath`.
|
||||
Currently, this includes the following languages: `bash`, `clojure`, `cpp`, `kotlin`, `markdown`, `php`, `php_phpactor`, `python`, `rust`, `toml`, `typescript`, `yaml`.
|
||||
We will add support for more languages over time.
|
||||
This is supported by all language servers deriving their dependency provider from `LanguageServerDependencyProviderSinglePath`,
|
||||
and by some additional wrappers that explicitly expose `ls_path`.
|
||||
Common examples include: `ansible`, `bash`, `clojure`, `cpp`, `cpp_ccls`, `hlsl`, `kotlin`, `lean4`, `luau`, `markdown`, `php`,
|
||||
`php_phpactor`, `python`, `rust`, `solidity`, `systemverilog`, `toml`, `typescript`, and `yaml`.
|
||||
|
||||
If a language server supports `ls_path`, setting it bypasses Serena's managed download or install for that server.
|
||||
In that case, any server-specific version or registry settings only apply when `ls_path` is not set.
|
||||
|
||||
#### AL
|
||||
|
||||
Serena uses the AL language server bundled in the Microsoft Dynamics 365 Business Central VS Code extension.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `al_extension_version` | `18.0.2242655` | Override the AL VS Code extension version Serena downloads from the VS Code Marketplace. |
|
||||
|
||||
#### Ansible
|
||||
|
||||
Serena uses `@ansible/ansible-language-server` for the `ansible` language key.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | managed install | Override the `ansible-language-server` executable path. |
|
||||
| `ansible_language_server_version` | `1.2.3` | Override the npm package version Serena installs when `ls_path` is not set. |
|
||||
| `npm_registry` | `null` | Override the npm registry Serena uses for the managed install. |
|
||||
| `ansible_path` | `"ansible"` | Path to the `ansible` executable forwarded to the language server. |
|
||||
| `ansible_settings` | `null` | Full Ansible LS settings dict, deep-merged on top of Serena's defaults. |
|
||||
| `lint_enabled` | `false` | Enable `ansible-lint` integration. |
|
||||
| `lint_path` | `"ansible-lint"` | Path to the `ansible-lint` executable. |
|
||||
| `python_interpreter_path` | `"python3"` | Python interpreter path forwarded to the language server. |
|
||||
| `python_activation_script` | `""` | Virtualenv activation script forwarded to the language server. |
|
||||
|
||||
#### Bash
|
||||
|
||||
Serena uses `bash-language-server` for Bash support.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | managed install | Override the `bash-language-server` executable path. |
|
||||
| `bash_language_server_version` | `5.6.0` | Override the npm package version Serena installs when `ls_path` is not set. |
|
||||
| `npm_registry` | `null` | Override the npm registry Serena uses for the managed install. |
|
||||
|
||||
#### Clojure
|
||||
|
||||
Serena uses `clojure-lsp` for Clojure support.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | managed download | Override the `clojure-lsp` executable path. |
|
||||
| `clojure_lsp_version` | `2026.02.20-16.08.58` | Override the `clojure-lsp` release version Serena downloads when `ls_path` is not set. |
|
||||
|
||||
#### C/C++ (`clangd`)
|
||||
|
||||
Serena uses `clangd` for the `cpp` language key.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | managed download | Override the `clangd` executable path. |
|
||||
| `compile_commands_dir` | `.serena` | Directory where Serena writes a transformed `compile_commands.json` if the project's original database uses relative `directory` entries. |
|
||||
| `clangd_version` | `19.1.2` | Override the `clangd` version Serena downloads when `ls_path` is not set. |
|
||||
|
||||
#### C/C++ via `ccls`
|
||||
|
||||
Serena uses the `cpp_ccls` language key for `ccls`.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | `ccls` from PATH | Override the `ccls` executable path. Serena does not manage `ccls` downloads or installs. |
|
||||
|
||||
|
||||
#### C# (Roslyn Language Server)
|
||||
|
||||
@@ -266,12 +338,14 @@ Automatic download is supported for: Windows (x64, ARM64), macOS (x64, ARM64), L
|
||||
**Configuration:**
|
||||
|
||||
The `runtime_dependencies` setting allows you to override the download URLs for the Roslyn Language Server. This is useful if you need to use a private package mirror or a specific version.
|
||||
For the common case of changing only the package version, use `csharp_language_server_version`.
|
||||
|
||||
Example configuration to override the language server download URL:
|
||||
|
||||
```yaml
|
||||
ls_specific_settings:
|
||||
csharp:
|
||||
csharp_language_server_version: "5.5.0-2.26078.4"
|
||||
runtime_dependencies:
|
||||
- id: "CSharpLanguageServer"
|
||||
platform_id: "linux-x64" # or win-x64, win-arm64, osx-x64, osx-arm64, linux-arm64
|
||||
@@ -294,6 +368,59 @@ Notes:
|
||||
- The language server package is a `.nupkg` file (ZIP format) downloaded from NuGet.org by default.
|
||||
- If you have .NET 10+ already installed, Serena will use your system installation.
|
||||
|
||||
#### C# (`OmniSharp`)
|
||||
|
||||
Serena uses the `csharp_omnisharp` language key for OmniSharp.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `omnisharp_version` | `1.39.10` | Override the OmniSharp version Serena downloads. |
|
||||
| `razor_omnisharp_version` | `7.0.0-preview.23363.1` | Override the Razor OmniSharp plugin version Serena downloads. |
|
||||
|
||||
#### Dart
|
||||
|
||||
Serena uses the Dart SDK's built-in language server for Dart support.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `dart_sdk_version` | `3.7.1` | Override the Dart SDK version Serena downloads. |
|
||||
|
||||
#### Elixir
|
||||
|
||||
Serena uses [Expert](https://github.com/elixir-lang/expert) for Elixir support.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `expert_version` | `v0.1.0-rc.6` | Override the Expert version Serena downloads when it does not use an `expert` executable already found in PATH. |
|
||||
|
||||
#### Elm
|
||||
|
||||
Serena uses `@elm-tooling/elm-language-server` for Elm support.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `elm_language_server_version` | `2.8.0` | Override the npm package version Serena installs when no system `elm-language-server` is found. |
|
||||
| `npm_registry` | `null` | Override the npm registry Serena uses for the managed install. |
|
||||
|
||||
#### F#
|
||||
|
||||
Serena uses FsAutoComplete (Ionide LSP) for F# support.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `fsautocomplete_version` | `0.83.0` | Override the FsAutoComplete version Serena installs as a .NET tool. |
|
||||
|
||||
|
||||
#### Go (`gopls`)
|
||||
|
||||
Serena forwards `ls_specific_settings.go.gopls_settings` to `gopls` as LSP `initializationOptions` when the Go language server is started.
|
||||
@@ -318,6 +445,45 @@ Notes:
|
||||
- `GOFLAGS` (from the environment you start Serena in) may also affect the Go build context. Prefer `buildFlags` for tags.
|
||||
- Build context changes are only picked up when `gopls` starts. After changing `gopls_settings` (or relevant env vars like `GOFLAGS`), restart the Serena process (or server) that hosts the Go language server, or use your client's "Restart language server" action if it causes `gopls` to restart.
|
||||
|
||||
#### Groovy
|
||||
|
||||
Serena uses a user-provided Groovy Language Server JAR for Groovy support. If `ls_java_home_path` is not set, Serena downloads
|
||||
a bundled Java runtime for launching that JAR.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_jar_path` | required | Path to the Groovy Language Server JAR |
|
||||
| `ls_java_home_path` | `null` | Path to a Java installation to use instead of Serena's managed runtime |
|
||||
| `ls_jar_options` | `""` | Additional options passed when launching the Groovy LS JAR |
|
||||
| `vscode_java_version` | `1.42.0-561` | Override the bundled Java runtime bundle version Serena downloads by default |
|
||||
|
||||
Note:
|
||||
- When overriding `vscode_java_version`, Serena still assumes that the downloaded runtime bundle keeps the same internal
|
||||
directory layout and file names as the bundled default version.
|
||||
|
||||
Example:
|
||||
|
||||
```yaml
|
||||
ls_specific_settings:
|
||||
groovy:
|
||||
ls_jar_path: "/path/to/groovy-language-server-all.jar"
|
||||
vscode_java_version: "1.42.0-561"
|
||||
```
|
||||
|
||||
#### HLSL
|
||||
|
||||
Serena uses `shader-language-server` for the `hlsl` language key.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | managed install or build | Override the `shader-language-server` executable path. |
|
||||
| `version` | `1.3.0` | Override the bundled version Serena downloads, or builds from source on macOS, when `ls_path` is not set. |
|
||||
|
||||
|
||||
#### Java (`eclipse.jdt.ls`)
|
||||
|
||||
The following settings are supported for the Java language server:
|
||||
@@ -329,6 +495,13 @@ The following settings are supported for the Java language server:
|
||||
| `gradle_wrapper_enabled` | `false` | Use the project's Gradle wrapper (`gradlew`) instead of the bundled Gradle distribution. Enable this for projects with custom plugins or repositories. |
|
||||
| `gradle_java_home` | `null` | Path to the JDK used by Gradle. When unset, Gradle uses the bundled JRE. |
|
||||
| `use_system_java_home` | `false` | Use the system's `JAVA_HOME` environment variable for JDTLS itself. Enable this if your project requires a specific JDK vendor or version for Gradle's JDK checks. |
|
||||
| `gradle_version` | `8.14.2` | Override the Gradle distribution version Serena downloads by default. |
|
||||
| `vscode_java_version` | `1.42.0-561` | Override the bundled `vscode-java` runtime bundle version Serena downloads by default. |
|
||||
| `intellicode_version` | `1.2.30` | Override the IntelliCode VSIX version Serena downloads by default. |
|
||||
|
||||
Note:
|
||||
- When overriding `vscode_java_version`, Serena still assumes that the downloaded runtime bundle keeps the same internal
|
||||
directory layout and file names as the bundled default version.
|
||||
|
||||
Example for a project with custom Gradle plugins and JDK requirements:
|
||||
|
||||
@@ -343,21 +516,44 @@ ls_specific_settings:
|
||||
|
||||
Serena uses [JetBrains' Kotlin Language Server](https://github.com/Kotlin/kotlin-lsp) for Kotlin support.
|
||||
|
||||
**Runtime Requirements:**
|
||||
Supported settings:
|
||||
|
||||
- Java 21 or higher is required. If not found, Serena automatically downloads an appropriate JRE.
|
||||
- The Kotlin Language Server is automatically downloaded from JetBrains' CDN.
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | managed download | Override the Kotlin Language Server executable path. |
|
||||
| `kotlin_lsp_version` | `261.13587.0` | Override the Kotlin Language Server version Serena downloads when `ls_path` is not set. |
|
||||
| `jvm_options` | `-Xmx2G` | Value assigned to `JAVA_TOOL_OPTIONS` for the Kotlin LS process. Set to `""` to disable JVM options entirely. |
|
||||
|
||||
**Configuration:**
|
||||
Example:
|
||||
|
||||
```yaml
|
||||
ls_specific_settings:
|
||||
kotlin:
|
||||
ls_path: "/path/to/kotlin-lsp.sh" # Override the Kotlin Language Server executable
|
||||
kotlin_lsp_version: "261.13587.0" # Override the Kotlin Language Server version
|
||||
jvm_options: "-Xmx4G -XX:+UseG1GC" # JVM options (default: -Xmx2G). Set to "" to disable.
|
||||
kotlin_lsp_version: "261.13587.0"
|
||||
jvm_options: "-Xmx4G -XX:+UseG1GC"
|
||||
```
|
||||
|
||||
#### Lean 4
|
||||
|
||||
Serena uses `lean --server` for Lean 4 support.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | `lean` from PATH | Override the `lean` executable path. Serena does not manage Lean downloads. |
|
||||
|
||||
#### Lua
|
||||
|
||||
Serena uses `lua-language-server` for Lua support.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `lua_language_server_version` | `3.15.0` | Override the bundled `lua-language-server` version Serena downloads when it cannot use an existing installation from PATH or common install locations. |
|
||||
|
||||
|
||||
#### Luau
|
||||
|
||||
Serena uses [`luau-lsp`](https://github.com/JohnnyMorganz/luau-lsp) for Luau support.
|
||||
@@ -373,6 +569,7 @@ Serena uses [`luau-lsp`](https://github.com/JohnnyMorganz/luau-lsp) for Luau sup
|
||||
ls_specific_settings:
|
||||
luau:
|
||||
ls_path: "/path/to/luau-lsp" # Optional: override the language server executable
|
||||
luau_lsp_version: "1.63.0" # Optional: override the bundled luau-lsp version
|
||||
platform: "roblox" # "roblox" (default) or "standard"
|
||||
roblox_security_level: "PluginSecurity" # Roblox only: None, PluginSecurity, LocalUserSecurity, RobloxScriptSecurity
|
||||
```
|
||||
@@ -381,6 +578,29 @@ Notes:
|
||||
- In `roblox` mode, Serena downloads Roblox definitions and Roblox API docs and passes them to `luau-lsp`.
|
||||
- In `standard` mode, Serena skips Roblox definitions and only downloads the standard Luau docs bundle.
|
||||
|
||||
#### Markdown
|
||||
|
||||
Serena uses [Marksman](https://github.com/artempyanykh/marksman) for the `markdown` language key.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | managed download | Override the `marksman` executable path. |
|
||||
| `marksman_version` | `2024-12-18` | Override the Marksman release tag Serena downloads when `ls_path` is not set. |
|
||||
|
||||
#### MATLAB
|
||||
|
||||
Serena uses the official MathWorks MATLAB language server from the VS Code extension.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `matlab_path` | auto-detected | Path to the MATLAB installation. This overrides `MATLAB_PATH` and auto-detection, but not Serena's managed extension download. |
|
||||
| `matlab_extension_version` | `1.3.9` | Override the MathWorks VS Code extension version Serena downloads. |
|
||||
|
||||
|
||||
#### Pascal (`pasls`)
|
||||
|
||||
Serena uses [pasls](https://github.com/genericptr/pascal-language-server) (Pascal Language Server) for Pascal/Free Pascal support.
|
||||
@@ -405,6 +625,7 @@ Configure pasls via `ls_specific_settings.pascal` in `serena_config.yml`:
|
||||
|
||||
| Setting | Description |
|
||||
| ---------------- | --------------------------------------------------------------------------- |
|
||||
| `pasls_version` | Override the pinned pasls version Serena downloads by default |
|
||||
| `pp` | Path to FPC compiler driver (must be `fpc` or `fpc.exe`, not `ppc386.exe`) |
|
||||
| `fpcdir` | Path to FPC source directory |
|
||||
| `lazarusdir` | Path to Lazarus directory (required for LCL projects) |
|
||||
@@ -426,6 +647,183 @@ Notes:
|
||||
- Use the FPC compiler driver (`fpc`/`fpc.exe`), not backend compilers like `ppc386.exe`.
|
||||
- These settings are passed as environment variables to the pasls process.
|
||||
|
||||
#### PHP (`Intelephense`)
|
||||
|
||||
Serena uses Intelephense for the `php` language key.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | managed install | Override the `intelephense` executable path. |
|
||||
| `intelephense_version` | `1.14.4` | Override the npm package version Serena installs when `ls_path` is not set. |
|
||||
| `npm_registry` | `null` | Override the npm registry Serena uses for the managed install. |
|
||||
| `ignore_vendor` | `true` | Ignore directories named `vendor` while indexing the project. |
|
||||
| `maxFileSize` | unset | Forwarded as `intelephense.files.maxSize` in `initializationOptions`. |
|
||||
| `maxMemory` | unset | Forwarded as `intelephense.maxMemory` in `initializationOptions`. |
|
||||
|
||||
#### PHP (`Phpactor`)
|
||||
|
||||
Serena uses the `php_phpactor` language key for Phpactor.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | managed download | Override the Phpactor PHAR path. |
|
||||
| `phpactor_version` | `2025.12.21.1` | Override the Phpactor PHAR version Serena downloads when `ls_path` is not set. |
|
||||
| `ignore_vendor` | `true` | Ignore directories named `vendor` while indexing the project. |
|
||||
|
||||
#### PowerShell
|
||||
|
||||
Serena uses PowerShell Editor Services for PowerShell support.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `pses_version` | `4.4.0` | Override the PowerShell Editor Services version Serena downloads. Serena still requires `pwsh` to be available locally. |
|
||||
|
||||
#### Python
|
||||
|
||||
Serena uses Pyright for the `python` language key.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | current Python executable | Override the Python interpreter Serena uses to run `-m pyright.langserver`. |
|
||||
|
||||
Note:
|
||||
- There is currently no separate `python_ty` language key in Serena's current SolidLSP implementation.
|
||||
|
||||
#### Ruby
|
||||
|
||||
Serena uses Shopify's `ruby-lsp` for Ruby support.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ruby_lsp_version` | `0.26.8` | Override the `ruby-lsp` gem version Serena installs when no project-local or global `ruby-lsp` is already available. |
|
||||
|
||||
#### Rust
|
||||
|
||||
Serena uses `rust-analyzer` for Rust support.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | auto-detected | Override the `rust-analyzer` executable path. Without `ls_path`, Serena prefers `rustup which rust-analyzer`, then `rustup component add rust-analyzer`, then PATH/common install locations. |
|
||||
|
||||
#### Scala
|
||||
|
||||
Serena uses Metals for Scala support.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `metals_version` | `1.6.4` | Override the Metals version Serena bootstraps. |
|
||||
| `client_name` | `Serena` | Client identifier sent to Metals. |
|
||||
| `on_stale_lock` | `auto-clean` | How Serena handles stale Metals H2 database locks. Supported values: `auto-clean`, `warn`, `fail`. |
|
||||
| `log_multi_instance_notice` | `true` | Log a notice when another Metals instance is detected. |
|
||||
|
||||
#### Solidity
|
||||
|
||||
Serena uses `@nomicfoundation/solidity-language-server` for Solidity support.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | managed install | Override the Solidity language server executable path. |
|
||||
| `solidity_language_server_version` | `0.8.4` | Override the npm package version Serena installs when `ls_path` is not set. |
|
||||
| `npm_registry` | `null` | Override the npm registry Serena uses for the managed install. |
|
||||
|
||||
#### SystemVerilog
|
||||
|
||||
Serena uses `verible-verilog-ls` for SystemVerilog support.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | system PATH or managed download | Override the `verible-verilog-ls` executable path. |
|
||||
| `verible_version` | `v0.0-4051-g9fdb4057` | Override the Verible release Serena downloads when `ls_path` is not set and no system installation is found. |
|
||||
|
||||
#### Terraform
|
||||
|
||||
Serena uses `terraform-ls` for Terraform support.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `terraform_ls_version` | `0.36.5` | Override the `terraform-ls` version Serena downloads. Terraform itself must still be installed and available in PATH. |
|
||||
|
||||
#### TOML
|
||||
|
||||
Serena uses [Taplo](https://github.com/tamasfe/taplo) for the `toml` language key.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | managed download | Override the `taplo` executable path. |
|
||||
| `taplo_version` | `0.10.0` | Override the Taplo version Serena downloads when `ls_path` is not set. |
|
||||
|
||||
#### TypeScript
|
||||
|
||||
Serena uses `typescript-language-server` for the `typescript` language key.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | managed install | Override the `typescript-language-server` executable path. |
|
||||
| `typescript_version` | `5.9.3` | Override the bundled `typescript` npm package version Serena installs when `ls_path` is not set. |
|
||||
| `typescript_language_server_version` | `5.1.3` | Override the bundled `typescript-language-server` npm package version Serena installs when `ls_path` is not set. |
|
||||
| `npm_registry` | `null` | Override the npm registry Serena uses for the managed install. |
|
||||
|
||||
#### TypeScript via `vtsls`
|
||||
|
||||
The actual configuration key for vtsls is `typescript_vts`, not `vts`.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `vtsls_version` | `0.2.9` | Override the `@vtsls/language-server` npm package version Serena installs. |
|
||||
| `npm_registry` | `null` | Override the npm registry Serena uses for the managed install. |
|
||||
|
||||
#### Vue
|
||||
|
||||
Serena uses `@vue/language-server` (Volar) for the `vue` language key, together with a companion TypeScript language server.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `vue_language_server_version` | `3.1.5` | Override the bundled `@vue/language-server` npm package version Serena installs. |
|
||||
| `npm_registry` | `null` | Override the npm registry Serena uses for the managed install. If unset on `vue`, Serena falls back to `ls_specific_settings.typescript.npm_registry`. |
|
||||
|
||||
Notes:
|
||||
- `typescript_version` and `typescript_language_server_version` are read from `ls_specific_settings.typescript`, not from `ls_specific_settings.vue`.
|
||||
|
||||
#### YAML
|
||||
|
||||
Serena uses `yaml-language-server` for the `yaml` language key.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | managed install | Override the `yaml-language-server` executable path. |
|
||||
| `yaml_language_server_version` | `1.19.2` | Override the npm package version Serena installs when `ls_path` is not set. |
|
||||
| `npm_registry` | `null` | Override the npm registry Serena uses for the managed install. |
|
||||
|
||||
### Custom Prompts
|
||||
|
||||
All of Serena's prompts can be fully customized.
|
||||
|
||||
@@ -1,12 +1,149 @@
|
||||
# Security Considerations
|
||||
|
||||
As fundamental abilities for a coding agent, Serena contains tools for executing shell commands and modifying files.
|
||||
Therefore, if the respective tool calls are not monitored or restricted (and execution takes place in a sensitive environment),
|
||||
there is a risk of unintended consequences.
|
||||
Security and protection against supply chain attacks are important to us, and we take this topic seriously.
|
||||
|
||||
Therefore, to reduce the risk of unintended consequences when using Serena, it is recommended to
|
||||
* back up your work regularly (e.g. use a version control system like Git),
|
||||
* monitor tool executions carefully (e.g. via your MCP client, provided that it supports it),
|
||||
* consider enabling read-only mode for your project (set `read_only: True` in project.yml) if you only want to analyze code without modifying it,
|
||||
* restrict the set of allowed tools via the [configuration](050_configuration),
|
||||
* use a sandboxed environment for running Serena (e.g. by [using Docker](docker)).
|
||||
Serena comes in two main variants with different security characteristics:
|
||||
|
||||
- the **JetBrains-based variant**, which integrates with a running JetBrains IDE, and
|
||||
- the **language-server-based variant** (the free variant), which can automatically acquire language-server dependencies on demand.
|
||||
|
||||
## JetBrains Variant
|
||||
|
||||
The JetBrains variant of Serena is safe by default.
|
||||
|
||||
At runtime, Serena does **not** download additional components and does **not** start extra helper processes beyond the Serena MCP server itself. It talks to the already running JetBrains IDE and relies on the IDE's own indexing and language intelligence.
|
||||
|
||||
This means that, from a supply-chain perspective, the JetBrains variant has a much smaller runtime attack surface than the language-server-based variant.
|
||||
|
||||
## Language-Server Variant
|
||||
|
||||
The language-server-based variant supports many languages, including languages whose language servers are not typically preinstalled on a machine. For convenience, Serena can therefore download or install certain language-server dependencies on demand.
|
||||
|
||||
We treat this path as security-sensitive and have hardened it accordingly.
|
||||
|
||||
### How Serena Secures Downloaded Language-Server Dependencies
|
||||
|
||||
For language servers that download archives, binaries, VSIX packages, NuGet packages, or other release artifacts, Serena uses a hardened shared download path with the following protections:
|
||||
|
||||
- **Pinned versions by default**: default downloads use exact versions instead of floating `latest` or nightly channels.
|
||||
- **Integrity verification**: downloaded artifacts are checked against pinned SHA256 hashes stored in Serena's source code.
|
||||
- **Host allowlists**: download URLs are restricted to the expected hosts for a given dependency.
|
||||
- **Safe extraction**: archive extraction validates paths to prevent path traversal and zip-slip style attacks.
|
||||
- **Managed install locations**: dependencies are installed into Serena-managed directories instead of into the project repository.
|
||||
|
||||
In practice, this means that a downloaded artifact must match all of the following:
|
||||
|
||||
- the expected version,
|
||||
- the expected host,
|
||||
- the expected SHA256 checksum,
|
||||
- and the expected extraction layout.
|
||||
|
||||
If any of these checks fail, Serena aborts the installation instead of continuing.
|
||||
|
||||
### npm-Based Language Servers
|
||||
|
||||
Some language servers are distributed primarily through npm. For those, Serena currently uses pinned package versions and installs them into Serena-managed directories.
|
||||
|
||||
By default, Serena uses the **user's normal npm configuration**. We do **not** force a registry override unless one is explicitly configured. If needed, both the package version and the registry can be overridden through `ls_specific_settings`.
|
||||
|
||||
For npm-based installs, Serena's current security posture is based on these rules:
|
||||
|
||||
- **Exact package versions are pinned by default**.
|
||||
- **The install location is isolated from the project** and lives in Serena-managed language-server directories.
|
||||
- **The user's npm configuration is trusted by default**.
|
||||
- **Repository and user configuration are assumed to be trusted**.
|
||||
|
||||
This means Serena protects well against accidental version drift, but npm installs still rely on the npm ecosystem and package-manager execution model. In particular, Serena does **not** currently use lockfile-based `npm ci` installs for bundled language-server dependencies.
|
||||
|
||||
### `uvx` and Python Dependency Pinning
|
||||
|
||||
Some parts of Serena rely on `uv` / `uvx`.
|
||||
|
||||
One important detail is that `uvx` ignores the lockfile when installing directly from a Git repository. Because of that, we pin Serena's Python dependencies exactly in `pyproject.toml` so that installations from Git still resolve to exact dependency versions rather than floating ranges.
|
||||
|
||||
For the `ty` Python language server, Serena also uses an exact pinned version when invoking it through `uvx`.
|
||||
|
||||
### Our Assumptions
|
||||
|
||||
The current security model for Serena's language-server variant assumes:
|
||||
|
||||
- the local machine is trusted,
|
||||
- the checked-out repository is trusted,
|
||||
- user configuration is trusted,
|
||||
- package-manager configuration such as npm config is trusted unless explicitly overridden,
|
||||
- and the main risk to defend against is compromised or unexpectedly changing upstream artifacts.
|
||||
|
||||
Under these assumptions, the most important supply-chain protections are:
|
||||
|
||||
- exact version pinning,
|
||||
- hash verification,
|
||||
- host restriction,
|
||||
- and isolated Serena-managed installation directories.
|
||||
|
||||
## Operational Recommendations
|
||||
|
||||
As fundamental abilities for a coding agent, Serena contains tools for executing shell commands and modifying files. Therefore, if the respective tool calls are not monitored or restricted, and execution takes place in a sensitive environment, there is a risk of unintended consequences.
|
||||
|
||||
To reduce that risk, we recommend that you:
|
||||
|
||||
- back up your work regularly, for example by using Git,
|
||||
- monitor tool executions carefully, if your MCP client supports this,
|
||||
- consider enabling read-only mode for analysis-only sessions by setting `read_only: True` in `project.yml`,
|
||||
- restrict the set of allowed tools via the [configuration](050_configuration),
|
||||
- and use a sandboxed environment for running Serena, for example by [using Docker](docker).
|
||||
|
||||
```{dropdown} What Serena Downloads by Default for Language Servers
|
||||
:open:
|
||||
|
||||
Only the language servers listed below download or install additional dependencies automatically by default when the required dependency is missing. Everything else either relies on a system-installed server or on tooling you install separately.
|
||||
|
||||
### Release Artifacts, Archives, or VSIX Packages
|
||||
|
||||
- **AL**: the pinned Microsoft AL VS Code extension (`ms-dynamics-smb.al`) from the VS Code Marketplace.
|
||||
- **C/C++ (`clangd`)**: pinned `clangd` release archives on supported platforms.
|
||||
- **C# (Roslyn LS)**: pinned Roslyn language-server NuGet package for the current platform.
|
||||
- **Clojure**: pinned `clojure-lsp` release artifact.
|
||||
- **Dart**: pinned Dart SDK archive that contains the language server.
|
||||
- **Elixir (`expert`)**: pinned Expert release binary, if not already available locally.
|
||||
- **Groovy**: pinned `vscode-java` runtime bundle used to provide Java for the Groovy LS setup.
|
||||
- **HLSL / shader-language-server**: pinned GitHub release artifacts on supported prebuilt platforms.
|
||||
- **Java (`eclipse.jdt.ls`)**: pinned Gradle distribution, pinned `vscode-java` extension bundle, and pinned IntelliCode VSIX.
|
||||
- **Kotlin**: pinned Kotlin LSP archive.
|
||||
- **Lua**: pinned `lua-language-server` release archive.
|
||||
- **Luau**: pinned `luau-lsp` release archive. In Roblox or standard-doc modes it may also download Luau/Roblox docs and type-definition files.
|
||||
- **Markdown (`marksman`)**: pinned Marksman release binary.
|
||||
- **MATLAB**: the pinned MathWorks MATLAB VS Code extension from the VS Code Marketplace.
|
||||
- **OmniSharp (legacy C# backend)**: pinned OmniSharp and Razor plugin archives.
|
||||
- **Pascal**: pinned Pascal language-server release artifact.
|
||||
- **PHP (`phpactor`)**: pinned `phpactor.phar`.
|
||||
- **PowerShell**: pinned PowerShell Editor Services archive.
|
||||
- **SystemVerilog (`verible`)**: pinned Verible release archive on supported platforms.
|
||||
- **TOML (`taplo`)**: pinned Taplo release artifact.
|
||||
- **Terraform**: pinned `terraform-ls` release archive. The Terraform CLI itself must still already be installed.
|
||||
|
||||
### npm Package Installs
|
||||
|
||||
- **Ansible**: `@ansible/ansible-language-server`
|
||||
- **Bash**: `bash-language-server`
|
||||
- **Elm**: `@elm-tooling/elm-language-server`
|
||||
- **PHP (`intelephense`)**: `intelephense`
|
||||
- **Solidity**: `@nomicfoundation/solidity-language-server`
|
||||
- **TypeScript**: `typescript` and `typescript-language-server`
|
||||
- **Vue**: `@vue/language-server`, plus `typescript` and `typescript-language-server`
|
||||
- **VTSLS**: `@vtsls/language-server`
|
||||
- **YAML**: `yaml-language-server`
|
||||
|
||||
All of the above are installed with exact pinned package versions by default, into Serena-managed directories.
|
||||
|
||||
### Other Package-Manager Based Installs
|
||||
|
||||
- **F#**: installs pinned `fsautocomplete` via `dotnet tool install`.
|
||||
- **Ruby (`ruby-lsp`)**: if not already available through Bundler or as a global executable, Serena installs a pinned `ruby-lsp` gem.
|
||||
- **Python (`ty`)**: launched through `uvx` / `uv x` using an exact pinned `ty` version.
|
||||
- **HLSL on macOS**: if no prebuilt binary is used, Serena builds `shader_language_server` from a pinned version using Cargo.
|
||||
|
||||
### No Automatic Download by Serena
|
||||
|
||||
- **Python (`pyright`)**: Serena uses the locally available Python environment and starts `pyright.langserver` from there.
|
||||
- **Go (`gopls`)**, **Rust (`rust-analyzer`)**, and several other system-tool based integrations expect the language server to be available locally and do not download it automatically.
|
||||
```
|
||||
Reference in new issue
Block a user