### abstract

- In this paper we present a model which can produce boundary confining condition on Dirac field interacting with Abelian or non Abelian gauge fields. The constraint is generated by a scalar field. This kind of model can be the foundation for bag models which can produce confinement. The present work represents among other things a generalization to the non Abelian case of our previous result where the Abelian case was studied. In the $U(1)$ case the coupling to the gauge field contains a term of the form $g(\phi)j_\mu (A^{\mu} +\partial^{\mu}B)$ where $B$ is an auxiliary field and $j_\mu$ is the Dirac current. The scalar field $\phi$ determines the local value of the coupling of the gauge field to the Dirac particle. The consistency of the equations determines the condition $\partial^{\mu}\phi j_\mu = 0$ which implies that the Dirac current cannot have a component in the direction of the gradient of the scalar field. As a consequence, if $\phi$ has a soliton behavior, like defining a bubble that connects two vacuua, we obtain that the Dirac current cannot have a flux through the wall of the bubble, defining a confinement mechanism where the fermions are kept inside those bags. In this paper we present more models in Abelian case which produce constraint on the Dirac or scalar current and also spin. Furthermore a model that give the M.I.T confinement condition for gauge fields is obtained. We generalize this procedure for the non Abelian case and we find a constraint that can be used to build a bag model. In the non Abelian case the confining boundary conditions hold at a specific surface of a domain wall.