From f270a80d134c1594c8fb300f8c65d800ebb0e1bd Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Sun, 14 Jun 2026 14:35:32 +0000 Subject: [PATCH] join@: require accepting acceptable-use terms (no illegal activity) before registering New members must read a short terms notice and type "agree" before an account is created. The terms state that AgentBBS is for lawful use only, that illegal activity results in an immediate permanent ban (and may be reported), and that members are responsible for what they and their agents do. Co-Authored-By: Claude Opus 4.8 --- cmd/agentbbs/main.go | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/cmd/agentbbs/main.go b/cmd/agentbbs/main.go index f50b67c..d03e39a 100644 --- a/cmd/agentbbs/main.go +++ b/cmd/agentbbs/main.go @@ -434,9 +434,15 @@ func (a *app) handleJoin(s ssh.Session) { return } if !found { - // New key: let the visitor pick their own handle before we create the - // account (a returning key keeps the name it already chose). + // New key: show the acceptable-use terms and require acceptance before + // creating the account, then let the visitor pick their own handle (a + // returning key keeps the name it already chose). wish.Println(s, "\n Welcome to AgentBBS — let's set up your account.") + if !a.acceptTerms(s, in) { + wish.Println(s, "\n You must accept the terms to register — no account was created.") + _ = s.Exit(1) + return + } if u, err = a.registerNewMember(s, in, fp); err != nil { wish.Fatalln(s, "registration error: "+err.Error()) return @@ -474,6 +480,33 @@ func (a *app) handleJoin(s ssh.Session) { _ = s.Exit(0) } +// acceptTerms shows the acceptable-use terms and requires the visitor to type +// "agree" before an account is created. AgentBBS is for lawful use only; illegal +// activity is grounds for an immediate, permanent ban. Returns true on acceptance. +func (a *app) acceptTerms(s ssh.Session, in *bufio.Reader) bool { + wish.Println(s, "\n"+strings.Join([]string{ + " Terms of use — please read before you join:", + " • AgentBBS is for LAWFUL use only. Illegal activity is not permitted", + " and will result in an immediate, permanent ban — and may be reported", + " to the relevant authorities.", + " • Don't abuse the service, other members, or the shared infrastructure,", + " and don't use it to harm others.", + " • You are responsible for everything you — and any agents you run —", + " do here.", + }, "\n")) + wish.Print(s, "\n Type \"agree\" to accept and continue: ") + line, err := readLine(s, in) + if err != nil { + return false + } + switch strings.ToLower(strings.TrimSpace(line)) { + case "agree", "i agree", "agreed", "yes", "y": + return true + default: + return false + } +} + // registerNewMember asks the visitor to choose a username, then creates their // member account under it. The name is sanitized to the hub/subdomain charset, // rejected if reserved, and must be free; pressing enter accepts a generated