Create sandboxed rich-text telegram agents with a single config file

montyanderson2 pts0 comments

GitHub - montyanderson/007: create sandboxed rich-text telegram agents with a single config file · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

montyanderson

007

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>1 Commit<br>1 Commit

.gitignore

.gitignore

007-demo.gif

007-demo.gif

README.md

README.md

agent.example.yaml

agent.example.yaml

agent.ts

agent.ts

config.ts

config.ts

deno.json

deno.json

deno.lock

deno.lock

main.ts

main.ts

sandbox.ts

sandbox.ts

sandbox_test.ts

sandbox_test.ts

telegram.ts

telegram.ts

View all files

Repository files navigation

007

create sandboxed rich-text telegram agents with a single config file

run

needs deno.

deno task start my-agent.yaml

config

this example is a research paper reader:

name: my-agent<br>telegram_token: "123456:ABC-DEF..."<br>anthropic_api_key: "sk-ant-..."<br>allowed_usernames:<br>- your-username<br>model: claude-opus-4-8 # optional<br>system: | # optional — defines what the agent is<br>you are a research paper reader assistant.<br>download all (html) papers you read and store them.<br>when embedding a figure, only use real image urls from arxiv.org.<br>sandbox: # optional — omit to deny all<br>net: ["arxiv.org"] # hosts, not urls<br>write: ["./papers"]<br>env: false

required: telegram_token, anthropic_api_key, allowed_usernames. the<br>system prompt is what turns the same engine into a paper reader, a maps<br>helper, a coding assistant, etc. — telegram formatting and the agent's sandbox<br>permissions are explained to it automatically, so system only needs the<br>persona.

the yaml holds secrets. don't commit it.

sandbox

the agent's one tool is run_javascript, which runs in a deno subprocess. each<br>sandbox entry maps to a deno --allow-* flag on that subprocess:

true → allow (unrestricted)

[list] → allow only those hosts/paths (e.g. --allow-net=a.com,b.com)

false / omitted → denied

omit the whole sandbox block and generated js gets zero permissions. denied<br>operations fail with a deno permission error returned to the agent. the agent is<br>told its exact permissions in its system prompt, so it knows what it can and<br>can't do.

rich formatting

replies are sent with telegram's sendRichMessage, so the agent's<br>github-flavored markdown renders natively: headings, bold /italic,<br>strikethrough, lists, task lists, blockquotes, code, fenced code blocks,<br>links, footnotes, latex formulas ($x^2$), tables, and media blocks<br>(![](url), including maps via ). a bad media url is stripped<br>and the message is retried so formatting never gets dropped wholesale.

features

typing indicator while it works

native rich-text replies (graceful fallback)

per-user conversation history (in memory, resets on restart)

streamed under the hood so long replies don't time out

test

deno task test

About

create sandboxed rich-text telegram agents with a single config file

Resources

Readme

Uh oh!

There was an error while loading. Please reload this page.

Activity

Stars

stars

Watchers

watching

Forks

forks

Report repository

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

TypeScript<br>100.0%

You can’t perform that action at this time.

agent deno telegram config sandbox rich

Related Articles