
Imagine a world where the behavior of any app or system is explicitly defined and shareable with its users. A chatbot can’t send your private data to an external server unless you say so. A social media app can’t serve your son or daughter harmful content. How can we do such a thing? Is it even possible? I argue yes.
Currently, this is specified in the terms and conditions or when you accept these annoying popups on every website to collect your cookies. It says something along the lines of: we send this data to some of our “partners”. Who are these partners, pal?
What if anything a software or a system does is declared as a public contract. Everybody can read it. Someone might say: Aha! that is how open source code works! Unfortunately that is wrong. There is a big misunderstanding that open source means anybody can read the code and understand its behavior when it’s running. Think of it this way: open source code is like a car at the dealership. Nobody can predict what the driver of this car will do with it. They might be a neutral operator or a harmful one.
What we need is an explicit way to tell the users or consumers of our software exactly the behavior of our software when it’s running. This should be a binding contract. That means I can understand exactly how this piece of software will affect me and my family. I know what I am accepting. Perhaps, I can use my own tools (maybe your AI agent) to read this piece of software and ask things about it like: is this piece of software ok for my child or not.
Currently this enforcement is centrlaized by auditing bodies. But comapnies are clever at bypassing and overriding them and they will play the legal game with the public. Ramifications are now happening through action lawsuits and so on. This is lengthy and exhausting to societieis and not possible in all of them. Each country has its own laws and its difficult to enforce law and ethics of each society separately.
I have attempted to create this in my programming language, Orb. You can observe who can read your data and if it leaves the boundries of the system to go outside of it.
Let’s take this piece of code:
orbital SocialOrbital {
entity Person [persistent: people, identity] {
id : string! @key
name : string!
external : "allowed" | "blocked" = blocked
}
entity Post [persistent: posts] {
@read ["=", (object/get @entity authorId) @user.id]
@update ["=", (object/get @entity authorId) @user.id]
id : string! @key
authorId : Person
text : string!
}
entity Share [persistent: shares] {
@read (or ["=", (object/get @entity recipientId) @user.id]
["=", (object/get @entity sharerId) @user.id])
id : string! @key
postId : Post
sharerId : Person
recipientId : Person
}
trait PostSharing -> Share [lifecycle] {
initial: idle
state idle {
INIT -> idle
SHARE_WITH_FRIEND -> idle
(persist create Share { postId: ?postId, sharerId: @user.id, recipientId: ?friendId })
SEND_OUTSIDE -> idle when (= @user.external "allowed")
(call-service "webhook" "send" { url: "https://example.com/hook", event: "post.shared" }
{ emit: { success: TRACKED, failure: FAILED } })
TRACKED -> idle
FAILED -> idle
(render-ui toast { type: "alert", variant: "error", message: "Could not send" })
}
listens {
SHARE_WITH_FRIEND { postId: string, friendId: string }
}
emits {
TRACKED -> external { postId: string }
FAILED -> internal { postId: string }
}
}
page "/shares" -> PostSharing
}
this represents a self contained block of code (I call behaviors) that handles posts. there is no other piece of code in the system that handles “posts”. You can think of it as a blog post or social media post, it doesn’t matter. By reading this I can decide to accept this “behavior” from a system I am using.
If we observe these lines:
entity Person [persistent: people, identity] {
id : string! @key
name : string!
external : "allowed" | "blocked" = blocked
}
entity Post [persistent: posts] {
@read ["=", (object/get @entity authorId) @user.id]
@update ["=", (object/get @entity authorId) @user.id]
id : string! @key
authorId : Person
text : string!
}
entity Share [persistent: shares] {
@read (or ["=", (object/get @entity recipientId) @user.id]
["=", (object/get @entity sharerId) @user.id])
id : string! @key
postId : Post
sharerId : Person
recipientId : Person
}
these represent where the data lives and how it’s accessed. You have three database tables: Person, Post and Share. it defines exactly how any post I share is read and updated. For example, only my friends can see this post:
@read (or [”=”, (object/get @entity recipientId) @user.id]
[”=”, (object/get @entity sharerId) @user.id])
Now, look at this part right here:
SHARE_WITH_FRIEND -> idle
(persist create Share { postId: ?postId, sharerId: @user.id, recipientId: ?friendId })
SEND_OUTSIDE -> idle when (= @user.external "allowed")
(call-service "webhook" "send" { url: "https://example.com/hook", event: "post.shared" }
{ emit: { success: TRACKED, failure: FAILED } })
the system tells you exactly where it sends data to external systems and when. I don’t want to go into teh details of the code, but SEND_OUTSIDE here specifies what happens when the system is about to send your data to an external system (when you agreed to it only). This is explicit in the code. This code is shared with the customer.
We should normalize being explicit about what software we use and what it’s doing with our data and information. This, in my opinion, can serve both big and small companies. Small comapnies can serve the needs of their local communities and thrive by being explicit. It can also set them apart from the big companies. In turn, big comapnies can be pressured to be more responsible and explicit on how they manipulate our data.
One caveat here: they will say that this is insecure. We can’t do it for all systems. I agree. But social media, chatbots and many others are definitely not one of these “sensitive” systems. Specifying the behavior of your software poses no risk to them.
If we think a bit ahead, in the upcoming era of technology, software is going to become a commodity, anyone can build it. The big AI players will have access to massive amounts of data and if we aren’t explicit about how this data is shared and manipulated, we will face problems. We should be discerning and select what is good for us and avoid harmful code and systems.
If you are interested to learn more about Orb. You can visit orb.almadar.io. It’s open source.