Skip to content

feat(sec-core): change daemon from user to system service - #3217

Merged
edonyzpc merged 4 commits into
agentic-os-org:mainfrom
RemindD:feat/sec-core/v2systemservice
Sep 16, 2026
Merged

edonyzpc merged 4 commits into
agentic-os-org:mainfrom
RemindD:feat/sec-core/v2systemservice

Conversation

@RemindD

@RemindD RemindD commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Why

What changed

  • Build, launch and deliver v2 daemon service as a system service

Related issue

User / Agent impact

Risk and compatibility

  • Public CLI, API, configuration, or documented behavior changed
  • Privileged or security-sensitive behavior changed
  • Cross-component contract changed
  • Migration or rollback guidance is needed

Validation

Documentation and rollback

@github-actions github-actions Bot added component:sec-core src/agent-sec-core/ scope:ci ./.github/ scope:documentation ./docs/|./*.md|./NOTICE scope:scripts ./scripts/ labels Sep 10, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c1f5e31e7f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agent-sec-core/v2/apps/asc-cli/src/lib.rs Outdated
Comment thread src/agent-sec-core/packaging/systemd/agent-sec-core-v2.service.in Outdated
@RemindD
RemindD force-pushed the feat/sec-core/v2systemservice branch 2 times, most recently from d52a48d to d2c0161 Compare September 10, 2026 12:15

@kongche-jbw kongche-jbw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review baseline: 628533bbb100ddf1f0e6db23a27115171f061367...d2c01616e312c844eac322f5575ace196208eace

[P1] Preserve privileged admission on the public socket

src/agent-sec-core/v2/crates/daemon/asc-daemon-service/src/server.rs:278
admits every peer against one global 64-connection semaphore before authorization. The daemon CLI
now publishes the socket as 0666, and each incomplete request retains a permit for five seconds.
Any local UID can therefore keep 64 partial connections open and make administrator requests hit
Busy indefinitely. Please keep the endpoint restricted until ingress isolation exists, or reserve
capacity by trusted peer identity. Add a cross-UID saturation test proving an administrator request
still completes while an ordinary UID holds its quota.

[P1] Update the public guides for the new service contract

src/agent-sec-core/README.md:37 still says the packaged daemon is a systemd user unit, while
docs/user-guide/en/agent-security/agent-sec-core/policy-cli.md:88 still marks --socket as
required; the Chinese mirrors have the same mismatches. The RPM now installs a system unit and both
binaries default to /run/agent-sec-core/daemon.sock, so users following the canonical install and
CLI docs get the wrong lifecycle and endpoint contract. Please update the paired README and
quick-start and Policy CLI pages with startup, authorization, upgrade/rollback, and socket-default
guidance, and
extend the documentation contract checks to lock these facts.

[P2] Isolate default-socket tests from the ambient environment

src/agent-sec-core/v2/apps/asc-cli/tests/commands.rs:300 and
src/agent-sec-core/v2/apps/asc-daemon/src/cli.rs:163 call the production parser and then assert
the hard-coded fallback without controlling AGENT_SEC_DAEMON_SOCKET. For example,
AGENT_SEC_DAEMON_SOCKET=/tmp/x cargo test default_socket_matches_the_system_service fails. This
makes the suite depend on the invoking shell or CI environment. Please inject the environment value
into a pure parser helper, and cover unset, empty, set, and explicit-argument precedence there.

@RemindD
RemindD force-pushed the feat/sec-core/v2systemservice branch 2 times, most recently from 37d4805 to a8813de Compare September 15, 2026 03:31
@RemindD

RemindD commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

Review baseline: 628533bbb100ddf1f0e6db23a27115171f061367...d2c01616e312c844eac322f5575ace196208eace

[P1] Preserve privileged admission on the public socket

src/agent-sec-core/v2/crates/daemon/asc-daemon-service/src/server.rs:278 admits every peer against one global 64-connection semaphore before authorization. The daemon CLI now publishes the socket as 0666, and each incomplete request retains a permit for five seconds. Any local UID can therefore keep 64 partial connections open and make administrator requests hit Busy indefinitely. Please keep the endpoint restricted until ingress isolation exists, or reserve capacity by trusted peer identity. Add a cross-UID saturation test proving an administrator request still completes while an ordinary UID holds its quota.

[P1] Update the public guides for the new service contract

src/agent-sec-core/README.md:37 still says the packaged daemon is a systemd user unit, while docs/user-guide/en/agent-security/agent-sec-core/policy-cli.md:88 still marks --socket as required; the Chinese mirrors have the same mismatches. The RPM now installs a system unit and both binaries default to /run/agent-sec-core/daemon.sock, so users following the canonical install and CLI docs get the wrong lifecycle and endpoint contract. Please update the paired README and quick-start and Policy CLI pages with startup, authorization, upgrade/rollback, and socket-default guidance, and extend the documentation contract checks to lock these facts.

[P2] Isolate default-socket tests from the ambient environment

src/agent-sec-core/v2/apps/asc-cli/tests/commands.rs:300 and src/agent-sec-core/v2/apps/asc-daemon/src/cli.rs:163 call the production parser and then assert the hard-coded fallback without controlling AGENT_SEC_DAEMON_SOCKET. For example, AGENT_SEC_DAEMON_SOCKET=/tmp/x cargo test default_socket_matches_the_system_service fails. This makes the suite depend on the invoking shell or CI environment. Please inject the environment value into a pure parser helper, and cover unset, empty, set, and explicit-argument precedence there.

Preserve privileged admission on the public socket: TODO already added in previous PR
Update the public guides for the new service contract: v2 is not released yet so doc update is limited in v2 folder
Isolate default-socket tests from the ambient environment: fixed

Comment thread src/agent-sec-core/agent-sec-core.spec.v2.in
Comment thread src/agent-sec-core/agent-sec-core.spec.v2.in Outdated
Comment thread src/agent-sec-core/agent-sec-core.spec.v2.in
@RemindD
RemindD force-pushed the feat/sec-core/v2systemservice branch from 71025ca to a7d136d Compare September 15, 2026 09:41
@RemindD
RemindD force-pushed the feat/sec-core/v2systemservice branch from a7d136d to d1d0889 Compare September 15, 2026 09:47
Comment thread src/agent-sec-core/Makefile
Comment thread src/agent-sec-core/Makefile
@RemindD
RemindD force-pushed the feat/sec-core/v2systemservice branch from 5d2ff1f to 26b066d Compare September 16, 2026 01:52

@edonyzpc edonyzpc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@edonyzpc
edonyzpc merged commit d940a66 into agentic-os-org:main Sep 16, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:sec-core src/agent-sec-core/ scope:ci ./.github/ scope:documentation ./docs/|./*.md|./NOTICE scope:scripts ./scripts/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants