silas 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08d5115f914d3ff251c01f57b506951e3367717d777bfdd3d175a165169552f7'
4
- data.tar.gz: 04e26fde565b7cf2d2a402316e095d6b0cf9f6a753b2d2444682890ec0ebe66f
3
+ metadata.gz: e6f592c5f4b254794f9a2a9cd4efc87d70b898f685f50ffff75c7af41415a7d8
4
+ data.tar.gz: 43871af8708f50e68803bc727975201d693ba4337ddf056f54062fb8e6070208
5
5
  SHA512:
6
- metadata.gz: 48d66589890f1c88e9ac8e1d476b131821907aea8c6e60d87300a42970e3e6a7bf52673020a94961f9bc32d2b3409cd6f735b6dfbb3d973ccaa86087298cb939
7
- data.tar.gz: 9ddc0ddbba4ad607ecba6443b85492e94d72a058aab78f13ad256d62c2d0631f0a8d61cc0f37cd902d2701e821b4e5248aa7a1076321a2fe25f34fbf13c5a6c9
6
+ metadata.gz: f1b8239d3d5eaaf1de6d199ac1a3fd53562cc7c1e8d8b6f67124974810fbe811692aa2d466a4d595660bca13cbc98c98ae0b500275bc54e216e2a2a4b8810fb5
7
+ data.tar.gz: d1a1132bb5b027b19e338e40b57ac9a418f8bdde7fefe11f1d20a196cf6f7ecd7999fd0f7209f45c1e21ef7445a313d65f88abd2dabe56c00fc5dafaf79e9279
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.2
4
+
5
+ - **Security (email channel scaffold): approvals no longer go to the session
6
+ initiator.** The generated `Agent::Channels::Email#deliver_approval` mailed the
7
+ approve link to `email["from"]` — the address that started the session, which
8
+ for a support agent is the customer, letting them approve their own gated
9
+ request. It now routes to a configured operator (`SILAS_APPROVER_EMAIL`) and
10
+ fails closed (sends nothing) if unset. The Slack scaffold was unaffected (its
11
+ card posts to the team channel/thread, not the initiator).
12
+
3
13
  ## 0.1.1
4
14
 
5
15
  - **Fix: parallel tool calls.** When the model emitted several tool_use blocks
@@ -10,9 +10,20 @@ class Agent::Channels::Email < Silas::Channel
10
10
  end
11
11
 
12
12
  def deliver_approval(session:, invocation:)
13
- email = session.metadata["email"] || {}
13
+ # SECURITY: an approval must go to an OPERATOR, never to whoever started the
14
+ # session. For an email-driven agent, session.metadata["email"]["from"] is
15
+ # the person who emailed in — often the customer — so mailing THEM the
16
+ # approve link lets them approve their own request. Route approvals to your
17
+ # ops/approver inbox instead, and fail closed if it isn't configured.
18
+ approver = ENV["SILAS_APPROVER_EMAIL"] # e.g. "approvals@yourcompany.com"
19
+ if approver.blank?
20
+ Rails.logger.warn("[Silas] SILAS_APPROVER_EMAIL unset — approval for " \
21
+ "invocation #{invocation.id} not emailed (won't send to the sender).")
22
+ return
23
+ end
24
+
14
25
  Silas::ChannelMailer.approval(
15
- to: email["from"], subject: "Approval needed: #{invocation.tool_name}", invocation: invocation
26
+ to: approver, subject: "Approval needed: #{invocation.tool_name}", invocation: invocation
16
27
  ).deliver_later
17
28
  end
18
29
  end
data/lib/silas/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Silas
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: silas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel St Paul